javascript find first in array of objects