To count the number of elements in an array using JavaScript, use the following

Example

                                        

var count = 0;

for(var i = 0; i

if(array[i] == 2)

count++;

}

Suggest An Answer

No suggestions Available!