Closed jdalton closed 11 years ago
I use the local typeOf
function to make it easier to minify. Also it looks like that an instanceof
check is quite faster that a call of the {}.toString
.
I use the local typeOf function to make it easier to minify.
Gzip will handle a lot of that.
Also it looks like that an instanceof check is quite faster that a call of the {}.toString.
Yap for sure, it's a balance of compliance vs common use. The toString.call()
will work cross-iframe and follows spec more closely, but it's up to you to frame your support.
I keep this in mind for a next update. ;)
I noticed in a few places you use the
Object.typeOf
function to check things likeundefined
orfunction
and you could simply use thetypeof
operator instead.Also you might tweak the method to use
var toString = {}.toString
and checktoString.call(value) == '[object RegExp]'
, it follows spec a bit more closely as with Array.isArray which is crazy fast too.