Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute JS code only in debug mode

Is it posible to execute part of a js file only when I have the developer tools opened?

I want something like

#if DEBUG
executeMethodOnlyInDebugger();
#endif

but for JavaScript.

like image 383
Andrew Avatar asked Oct 19 '15 14:10

Andrew


1 Answers

No, there is no conditional compilation natively in javascript.

like image 117
Jamiec Avatar answered Sep 19 '22 02:09

Jamiec