top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to disable console.log statements in JavaScript?

0 votes
473 views
How to disable console.log statements in JavaScript?
posted Jan 25, 2019 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

For disable, you need to redefine the console.log function in your script.
Example:

console.log = function() {}
answer Jan 31, 2019 by Aarati Mahajan
Similar Questions
+5 votes

I need disable all refresh events

Example.

  1. F5,
  2. Mouse right click option (refresh/reload),
  3. CTRL+R,
  4. Menu bar -> view -> refresh and
  5. URL refresh/reload button

How to disable these all events by using javascript...

Advance thanks....

+5 votes

I have a C code like this:

int foo(void)
{ 
 int phase;
 . . .
 phase = 1;
 phase = 2;
 phase = 3;
 . . .
}

In case of -O0 gcc generates machine instructions for every assignment 'phase = ...'. But in case of -O2 gcc does not generate instructions for some assignments. Of course, this is correct. However, is there any way to tell gcc that 'phase' object is inspected by another thread, so it should not remove such statements?

...