Use the native isArray whenever possible. See perf test by jdalton here: http://jsper...
[jquery.git] / src / core.js
index 81a920b..6e1f745 100644 (file)
@@ -441,15 +441,13 @@ jQuery.extend({
                return jQuery.type(obj) === "function";
        },
 
-       isArray: function( obj ) {
+       isArray: Array.isArray || function( obj ) {
                return jQuery.type(obj) === "array";
        },
 
        type: function( obj ) {
-               return obj === null ?
-                       "null" :
-                       obj === undefined ?
-                       "undefined" :
+               return obj == null ?
+                       String( obj ) :
                        toString.call(obj).slice(8, -1).toLowerCase();
        },