Skip navigation

Monthly Archives: May 2013

Happen to see this nice cool JavaScript code somewhere in web.

function is(it) { 
   alert(this+" is " +it);
is("global");  // [object Window] is global,"number");  // 5 is number
is.apply("A", ['string']);  // A is string;"function");  // function alert() { [native code] } is function

is it JavaScript? its upto you to call or apply.

Hope JavaScript folks enjoy this.