I am new to javascript so my terminologies might be wrong. Since functions are just variables in javascript, why does the Chrome console complain when I do
var f = console.log
and apply
f(123)
The error log is the following.
Uncaught TypeError: Illegal invocation
at <anonymous>:2:1
at Object.InjectedScript._evaluateOn (<anonymous>:905:140)
at Object.InjectedScript._evaluateAndWrap (<anonymous>:838:34)
at Object.InjectedScript.evaluate (<anonymous>:694:21)