jQuery.isArray()

 jQuery.isArray( obj )
 //测试obj是不是一个数组
 //$.isArray() returns a Boolean indicating whether the object is a JavaScript array (not an array-like object, such as a jQuery object).


 <!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
  Is [] an Array? <b></b>
<script>$("b").append( "" + $.isArray([]) );</script>

</body>
</html>

//reslut:
Is [] an Array? true

你可能感兴趣的:(jquery)