That revision tests the best case (looking for string &quot;a&quot;) while the revision I picked tests the worst case (looking for string &quot;xxx&quot;, which doesn&#x27;t exist). I picked it just because it came up first in Google search. Testing in my browser (Safari 9.0.1, Mac OS X 10.10.5) still gives a 54x improvement to Object indexing, though.<p>Perhaps getting the first value in an array is faster than indexing an Object in your browser.<p>The point is, if the thing doesn&#x27;t exist, this part of the program will be thousands of times slower, and will get slower as the list of roles grows. Meanwhile, the hash map will not.