Browsers differ in their console implementations, it seems that WebKit / Blink browsers (Chrome, Opera 15+, Safari, etc.) are the only ones that are inconvenient when retrieving console methods. For browser compatibility, the extracted methods must be related:
var log = console.log.bind(console);
Node has its own console implementation, which relies on this , but pre-binds its methods . Safely retrieving console methods in Node applications, the same applies to the main Electron process.
NW.js replaces Node console with Chromium's:
Node.js and Chromium have their own setTimeout and console implementations. Currently, for the console, we use the Chromium implementation everywhere because it can print to devtools and provide more information.
It is not safe to retrieve console methods in the context of an NW.js Node.
estus source share