how to select all elements in array javascript