javascript hashmap check if key exists