Return to Snippet

Revision: 53272
at November 17, 2011 21:41 by bharmalammargmailcom


Initial Code
Object.toType = (function toType(global) {
  return function(obj) {
    if (obj === global) {
      return "global";
    }
    return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase();
  }
})(this)

Initial URL

                                

Initial Description

                                

Initial Title
Using "typeof" operator in Javascript

Initial Tags

                                

Initial Language
JavaScript