Basic JavaScript: Using Objects for Lookups answer key code example
Example: using objects for lookups in javascript
var alpha = {
1:"Z",
2:"Y",
3:"X",
4:"W",
24:"C",
25:"B",
26:"A"
};
alpha[2]; // "Y"
alpha[24]; // "C"
var value = 2;
alpha[value]; // "Y"