console.log() called on object other than console
问题 I remember that always when I wanted to pass console.log as a callback parameter to some function, it didn't work unless I used the bind() method to bind console to it. For example: const callWithTest = callback => callback('test'); callWithTest(console.log); // That didn't use to work. callWithTest(console.log.bind(console)); // That worked (and works) fine. See Uncaught TypeError: Illegal invocation in javascript. However, recently I noticed that console.log() works fine even when called on