3 ms·
See? There's the problem. Since there's no conclusion between vendors on console object API, console.log function may not have .apply method. It's not only the
by Inviz 15y ago
See? There's the problem. Since there's no conclusion between vendors on console object API, console.log function may not have .apply method.
It's not only the console object functions actually, most of the browsers choke on a [1,2,3].forEach(alert) and other [Native Code] functions.
- gonchuki 15y agoFunction.prototype.apply.apply(console.log, [console, arguments]); Works both on IE9 broken console.log, and regular console.log from other vendors. Same hack as using Array.prototype.slice to convert arguments into a real array.