javascript array find first index