by ravicious · 11y ago · 0 comments
I don't particularly like this solution, because now I can't just write `this.rename()` in other Person functions. That's why I'd rather have a baked-in way to define private properties & functions instead of having to use (in my opinion) this weird syntax and later explain the whys and hows to other developers.
Your solution mostly works, but a simpler one takes advantage of combining computed property keys and compact method syntax:
(I wrote about them extensively years back here: http://mikegerwitz.com/papers/coope/coope.pdf.)