Find Last Index Array Javascript Push Function