Use js method of getting a random element from an array not ruby