Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on JavaScript debugging for beginners.
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.
There are no comments on this comment yet.
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.