alert - global method ( window.alert ). If you call it alert.call(this) , this is a window object.
Since the log is a method in the console object, it expects this be the console object itself, but you still call it with this ( window ), so you get an error message.
Running console.log.call(console, 'test') will work fine.
source share