JavaScript: How to implement a dictionary/map in 3mins.