ドキュメント

Utilities/jQuery.isArray

From jQuery JavaScript Library

Jump to: navigation, search

« Back to Utilities

jQuery.isArray( obj )

Added in jQuery 1.3 Determine if the parameter passed is an array.
Arguments:
objObject
Object to test whether or not it is an array.
Examples:

Finds out if the parameter is an array.

$("b").append( "" + $.isArray([]) );

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<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>

NameType