java like implementation of hashmap  or key-value pairs in javascript using dictionary