r/javascript • • Dec 16 '18

Coming from Python to JS NSFW

const print = console.log

I found my safe space.

607 Upvotes

156 comments sorted by

View all comments

3

u/IrishLimey Dec 17 '18

Here's a global version that will output the correct line number in the console as well:

(typeof global !== 'undefined' ? global : window)['print'] = (function() { return Function.prototype.bind.call(console.log, console); })();

1

u/senocular Dec 17 '18

aaaaand now I can't print my page.

1

u/IrishLimey Dec 18 '18

Meh, print is dead.