macro definition in javascript

后端 未结 6 730
一向
一向 2021-01-01 22:07

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         


        
6条回答
  •  醉话见心
    2021-01-01 23:10

    Javascript has no macros since there is no compiler. You could use console.log and write a regex to strip those statements when deploying.

提交回复
热议问题