tadam logo
Did you find an error in the text?
Select this with mouse and press
Ctrl + Enter
Xhtml.co.il Check Spelling
Orphus system

jQuery.isArray()

jQuery.isArray( obj )

Returns: Boolean

Description: Determine whether the argument is an array.

jQuery.isArray( obj )

version added: 1.3
obj
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).

Examples

Finds out if the parameter is an array.
$("b").append( "" + $.isArray([]) );
The output of the code above will be:
Full source:
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
  <script>
  $(document).ready(function(){
    $("b").append( "" + $.isArray([]) );
  });
  </script>
</head>
<body>
  Is [] an Array? <b></b>
</body>
</html>
Was this information helpful?
   

Comments