javascript - cannot let another variable point to console.log -
this question has answer here:
i new javascript terminologies might wrong. since functions variables in javascript, why chrome console complain when
var f = console.log
and apply
f(123)
the error log following.
uncaught typeerror: illegal invocation @ <anonymous>:2:1 @ object.injectedscript._evaluateon (<anonymous>:905:140) @ object.injectedscript._evaluateandwrap (<anonymous>:838:34) @ object.injectedscript.evaluate (<anonymous>:694:21)
works here: http://jsfiddle.net/8pl5lgd2/
var f = console.log; f("!23");
Comments
Post a Comment