All this time I've lived with the impression that "public" methods (declared in a prototype) cannot access "private" members of constructor functions. Turns out that this is possible, as long as the "private" member is declared without
var standing in front.
Compare it with this one:
No comments:
Post a Comment