I have this "class":
function BooleanAssoc(keyNames) {
this.assoc = {};
$.each(keyNames, function(i, val) {
this.assoc[val] = false;
});
};
I use it like this:
var signUpStates = new BooleanAssoc([
"CNPJ",
"PASSWORDS",
"ADDRESS",
"GENERAL_FIELDS",
"STATE",
"CITY",
"SEGMENT",
"PRODUCT",
"EMAIL",
"TERMS"
]);
I don't understand why I get a TypeError. Perhaps it's my mind that is too "pythonic". I create a dictionary ("Associative Array"), I iterate over a list of strings and create the keys and assign their values accordingly. What am I doing wrong??
$.eachtothis:$.each(key...(i, val){}.bind(this)).