by mvclark · 12y ago · 0 comments
function log(x) {console.log(x);};
You'd use log instead of console.log for debugging your code. Then, to turn off logging, you set
function log(x) {};
or have a boolean switch in log function to do a similar thing. You could even use this approach to define debug levels to enable/disable.
No comments yet.