SwVitaliy

Untitled

Jun 2nd, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function instanceOfBuiltInType(o, type) {
  2.   type = type.toLowerCase();  
  3.   var t = o.constructor.toString();
  4.  
  5.   if( t.length === type.length) { t = t.toLowerCase(); return type === t; }
  6.  
  7.   return t.slice(0,12 + type.length).toLowerCase() === ("function " + type + "() ");
  8. }
Advertisement
Add Comment
Please, Sign In to add comment