Indexof Array Javascript Object Length