how to count array elements in javascript code example Example: length of an array javascript array.length