I'd like to pass a variable into the key of my monthHash
variable here:
var monthHash = new Array();
monthHash["JAN"] = "Jan";
monthHash["FEB"] = "Feb";
...
monthHash["NOV"] = "Nov";
monthHash["DEV"] = "Dec";
Such that I can do this:
alert(monthHash[the_variable]);
Instead of using a switch case to go through this.
When I try, however, I get an error. Is there a way I can have a variable indicate a string identifier for the key in JavaScript?