Just poking around, could you explain why https://jsperf.com/indexof-vs-object-lookup/32 indexOf is the fastest in this revision?
Perhaps getting the first value in an array is faster than indexing an Object in your browser.
The point is, if the thing doesn'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.
[1] http://stackoverflow.com/questions/17295056/array-vs-object-...