Javascript Select Random Index From Array To Hashmap Internal Implementation