Tutorials Point


  JavaScript Basics
  JavaScript Objects
  JavaScript Advanced
  JS Useful References
  JS Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

Javascript Array length Property


previous next AddThis Social Bookmark Button


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:

  • NA

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 Printer Friendly

Advertisements


  

Advertisements