How to find array length in JavaScript

{0 Comments}

To find the length of an array JavaScript inbuilt function will help you that itself named as ‘length’ this will return array length, it can also can be used to set the array length. Following is the syntax to understand how you can use this.

 Javascript |  copy code |? 
1
<script type="text/javascript">
2
 
3
Array.length=number//set the array length
4
 
5
Array.length//return the length of array
6
 
7
</script>
8

Leave a Comment

Your email address will not be published.