jQuery.isArray()
jQuery.isArray( obj ) 返回: boolean
描述: 確定的參數(shù)是一個(gè)數(shù)組。
-
version added: 1.3jQuery.isArray( obj )
obj用來測試是否為一個(gè)數(shù)組的對(duì)象。
$.isArray() 返回一個(gè)布爾值指明對(duì)象是否是一個(gè)JavaScript數(shù)組(而不是類似數(shù)組的對(duì)象,如一個(gè)jQuery對(duì)象)。
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>