Return to Snippet

Revision: 45158
at April 26, 2011 15:02 by alvincrespo


Initial Code
window.log = function(){
  var output = Array.prototype.slice.call(arguments);
  window.console ? console.log(output) : alert(output);
}

Initial URL


Initial Description
Basically creates a log function on the window object and uses console.log or alert depending on which is supported. Very basic and simple but definitely useful.

Initial Title
Console.log Detection

Initial Tags
javascript, log

Initial Language
JavaScript