Simplify the logic in $.type, thanks to jdalton for the suggesiton in 5d2be7e299.

This commit is contained in:
John Resig 2010-08-27 07:03:30 -07:00
parent 5d2be7e299
commit 7f18d29287

View File

@ -446,10 +446,8 @@ jQuery.extend({
}, },
type: function( obj ) { type: function( obj ) {
return obj === null ? return obj == null ?
"null" : String( obj ) :
obj === undefined ?
"undefined" :
toString.call(obj).slice(8, -1).toLowerCase(); toString.call(obj).slice(8, -1).toLowerCase();
}, },