Array Lenght Property

| 0 Comments


Syntax for Array Lenght Property in Javascript


To find size of array, you can use length property in javascript.

//Declare Arrayvar objArray = new Array(5);

//Find Length of Array
alert(objArray.length);

//Following is example of finding length of array
<script language="javascript">
<!--
function TestArray() {
//Declare Two-Dimensional Array//Array Size is of 10var objArray = new Array(5);

//Find Length of Array
alert("Array Lenght: " + objArray.length);
}
// -->
</script>



Example for Array Lenght Property in Javascript


Please click on Find Array Length button to find length of array.

Leave a Reply