A Simple Logging Function for JavaScript

Prints all the arguments of the function. This function uses console.log if firebug is available – else, uses alert.


function p() {
                for(var i=0; i<<arguments.length; i++) {
			if(window.console) console.log(arguments[i]);
			else alert(arguments[i]);
		}
}
Author: Binny V A
A philosopher programmer who specializes in backend development and stoicism.

Leave a Reply

Your email address will not be published. Required fields are marked *