Thinking out of the box for a second, if you are making this call many many times, it is vastly more efficient to use an associative array a Map to do lookups using a hash function.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map