Is this still true in every browser? I've noticed in Chrome that I can do promise.then(console.log), and I'm pretty sure that didn't work a few years ago.
It depends on the context. It also won’t throw an error but it won’t work in some cases either. Particularly if you pass console.log as a function to a tap in an observable pipe.
84
u/uberpwnzorz Dec 17 '18
you need to use bind so the log function keeps the context of console.
const print = console.log.bind(console)