Js Get Subarray From Array To Hashmap Vs Hashing