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