返回值:booleanjQuery.isArray(obj)
Determine whether the argument is an array.
-
1.3 新增jQuery.isArray(obj)
obj (Object) Object to test whether or not it is an array.
$.isArray()
returns a Boolean indicating whether the object is a JavaScript array (not an array-like object, such as a jQuery object).
示例:
Finds out if the parameter is an array.
<!DOCTYPE html>
<html>
<head>
<script src="jquery.min.js"></script>
</head>
<body>
Is [] an Array? <b></b>
<script>
$("b").append( "" + $.isArray([]) );
</script>
</body>
</html>