Monday, May 20, 2024
139
rated 0 times [  141] [ 2]  / answers: 1 / hits: 27508  / 13 Years ago, wed, november 16, 2011, 12:00:00

If you run this in the chrome console:



console.log.apply(null, [array])


Chrome gives you back an error:



// TypeError: Illegal Invocation


Why? (Tested on Chrome 15 via OSX)


More From » google-chrome

 Answers
4

It may not work in cases when execution context changed from console to any other object:




This is expected because console.info expects its this reference to
be console, not window.



console.info(stuff)
stuff
undefined
console.info.call(this, stuff)
TypeError: Illegal invocation
console.info.call(console, stuff)
stuff
undefined


This behavior is expected.




https://bugs.chromium.org/p/chromium/issues/detail?id=48662


[#89076] Tuesday, November 15, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
malkajillc

Total Points: 652
Total Questions: 107
Total Answers: 98

Location: Finland
Member since Sat, Nov 6, 2021
3 Years ago
malkajillc questions
;