I want to create an associative array:
var aa = {} //equivalent to Object(), new Object(), etc...
and I want to be sure that any key I access is going to be a number:
aa['hey'] = 4.3;
aa['btar'] = 43.1;
I know JS doesn't have typing, so I can't automatically check this, but I can ensure in my own code that I only assign strings to this aa.
Now I'm taking keys from the user. I want to display the value for that key. However, if the user gives me something like "toString", he'll get back a function, not an int! Is there any way to make sure any string he gives me is only something I define? Is the only solution something like:
delete aa['toString'];
delete aa['hasOwnProperty'];
etc...