Javascript best practice: handling Firebug-specific code

前端 未结 9 768
春和景丽
春和景丽 2021-02-03 10:31

Firebug is certainly a wonderful tool for javascript debugging; I use console.log() extensively.

I wanted to know if I can leave the Firebug-specific code in production.

9条回答
  •  梦如初夏
    2021-02-03 10:53

    Some compressors will strip out any line prefixed by ;;; (which is a legal sequence to have, being three empty statements.) This way you're not strictly limited to console references (i.e. you could do some calculations and then console.log() the result at the end, and the compressor can strip all of them out.) I use JavaScript::Minifier for this.

提交回复
热议问题