What is best practice for debugging in JavaScript?
debugging ? console.log('info') : null;
My question is the null
, what is standard practice for this in general, or in this debugging use case?
In your case:
debugging && console.log('info');
This trick is based on the "short circuit" feature and I suppose this info might be useful: http://en.wikipedia.org/wiki/Short-circuit_evaluation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With