figure out some convention to do console output that doesn't break on browsers that don't support the console. Maybe something like:
//->console.log("hello world")
figure out some convention to do console output that doesn't break on browsers that don't support the console. Maybe something like:
//->console.log("hello world")
2. some browsers provide console.log but not others
3. those methods most of the time are not .apply'able or .call'able. that matters when you try to output an array of items with the right firebug/devtools coloring. But you cant. You get the ["Message", "was sent", {Object}] output with the arrayish square brackets and all strings with the double quotes. If you pass values directly via console.log(type, action, object) the output will not have double quotes around each string and the "Message was sent" part will read as one sentence, not two values of one array.
4. Some combinations of firefox (i think ff4) with firebug (even disabled) raise exceptions when you attempt to redefine one of the console objects. The exception alone renders some of the sites broken.
Handling the console object is needlessly painful and hard. Someone has to stop it.
function myLog() {
if(window.console && window.console.log) {
window.console.log(arguments)
}
}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.
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.