Javascript dictionary performance question
问题 Right now I have the following javascript dictionary var a = {}; a['SVG343'] = 1942; a['UAL534'] = 2153; Those numbers on the right represent times, and the keys are unique ids. I wanted to make the ids the keys since they are unique. My problem is given a time find the corresponding id. How was I going to do this was go through each entry in the dictionary until I find the correct time and use the current key to get the id. However I'm worried about performance, my question is, does going