Access First Object In Array Javascript Function