Javascript array length property returns an unsigned, 32-bit integer that specifies the number of elements in an array.
Its syntax is as follows −
array.length
Returns the length of the array.
Try the following 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>
arr.length is : 3