Asked 2 years ago
15 Apr 2022
Views 722
debugger

debugger posted

Javascript : How to count length of array?


var a=[1.2.3.4.5];
a.count()

how to count how many element in the array in javascript ?
shyam

shyam
answered Apr 15 '22 00:00

there is no count() function in javascript for the array.

 totalnoofelementinarray = ["ca", "e", "a", "3"];
totalnoofelementinarray = fruits.length;alert(totalnoofelementinarray)

there is length property for array which return count of the element in the array
Post Answer