Get Last Object In Array Javascript Length Function