I have a list of a few thousand integer keys. The only thing I need to do with this list is say whether or not a given value is in the list.
For C# I would use a
You can use just a regular JavaScript object and the 'in' keyword to see if that object has a certain key.
var myObj = {
name: true,
age: true
}
'name' in myObj //returns true;
'height' in myObj // returns false;
Or if you know you're going to have keys in your object that might be built in JavaScript object properties use...
var myObj = {
name: true,
age: true
}
myObj.hasOwnProperty('name') //returns true;
myObj.hasOwnProperty('height') // returns false;