4 ms·
window.console.log.apply(window.console, arguments)
by jdunck 15y ago
window.console.log.apply(window.console, arguments)
- Inviz 15y agoSee? 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.