Copyright © tutorialspoint.com

Javascript Array length Property

previous next

Advertisements


Description:

Javascript array length property returns an unsigned, 32-bit integer that specifies the number of elements in an array.

Syntax:

array.length

Here is the detail of parameters:

Return Value:

Returns the length of the array.

Example:

<html>
<head>
<title>JavaScript Array length Property</title>
</head>
<body>
<script type="text/javascript">
   var arr = new Array( 10, 20, 30 );
   document.write("arr.length is : " + arr.length); 
</script>
</body>
</html>

This will produce following result:

arr.length is : 3 

To understand it in better way you can Try it yourself.


previous next

Copyright © tutorialspoint.com