jQuery.isArray()

jQuery.isArray( obj ) 官网原E文: boolean

描述: 确定的参数是一个数组。

  • version added: 1.3jQuery.isArray( obj )

    obj用来测试是否为一个数组的对象。

$.isArray() 返回一个布尔值指明对象是否是一个JavaScript数组(而不是类似数组的对象,如一个jQuery对象)。

Example:

Finds out if the parameter is an array.

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

</body>
</html>

Demo:

jQuery 1.6 API 中文版Clove整理、修订