HashMap implementation of javascript