Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

JavaScript: length of the array

Tags: array elements
‘arrayName.length’ property return number of Elements in Array.

array.html





Array



"text/javascript">
var array = [2, 3, 5, 7, 11, 13];

function printArray(arr) {
document.write("Elements in Array are : ");
for (var i = 0; i arr.length; i++) {
document.write(arr[i] + " ");
}
}

document.write("Length of array is " + array.length + "
"
);
printArray(array);





Open above page in browser, you can able to see following data.

Length of array is 6
Elements in Array are : 2 3 5 7 11 13



Previous                                                 Next                                                 Home


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

JavaScript: length of the array

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×