Is there a way that I can define a macro similar to C/C++ macros in Javascript?
I want to use this for debug statements: Something like
#ifdef TEST
var de = false; // true when debugging function bug( msg ){ ... display msg ... }
Usage:
de&&bug( "hello world")
When "de" is false (production mode), the overhead is minimal.