var Person = function(first last) {
this.fullName = function() {
return first + " " + last;
};
this.rename = function(newFirst, newLast) {
first = newFirst;
last = newLast;
};
};
Problem solved, you can't access `first` and `last` outside the class. You might retort "they're bigger" or something but just like everything else in JS they just need the right people to concentrate on them and they'll likely get optimized.I don't get the relucatance to use the language's features rather than hacks (using naming standards and compilers to obfusticate names and then cross fingers) or other hacks (Symbol). Really? You Really want me to write code using Symbol? That's going to be awesome in the debugger. Let's add a watch to "weke30o304_first". Refresh, of shit it's now "gtgrf40r3fe_first", my watches all broke (T_T)
It also makes me sad the `class` spec didn't take that into account so you could use a closure with a `class`.