nl_tokens: Public : Returns a string indicating the type of the given object . This can be considered an enhanced version of the javascript typeof operator . Examples Transis . type ( [] ) // = > array Transis . type ( {} ) // = > object Transis . type ( 9 ) // = > number Transis . type ( / fo * / ) // = > regexp Transis . type ( new Date ) // = > date o - The object to get the type of . Returns a string indicating the object s type .
pl_tokens: function type ( o ) { if ( o === null ) { return 'null' ; } if ( o === undefined ) { return 'undefined' ; } switch ( toString . call ( o ) ) { case '[object Array]' : return 'array' ; case '[object Arguments]' : return 'arguments' ; case '[object Function]' : return 'function' ; case '[object String]' : return 'string' ; case '[object Number]' : return 'number' ; case '[object Boolean]' : return 'boolean' ; case '[object Date]' : return 'date' ; <mask> '[object RegExp]' : return 'regexp' ; case '[object Object]' : if ( o . hasOwnProperty ( 'callee' ) ) { return 'arguments' ; } // ie fallback else { return 'object' ; } } return 'unknown' ; }