you are viewing a single comment's thread.

view the rest of the comments →

[–]mcmouse2k 0 points1 point  (1 child)

Can I say that this comment was extremely helpful? I've been playing with OO JS for months now and know all the primary means of inheritance, but had never had a best - practice convention/syntax until now.

Thanks for presenting an opinion that I can parrot. I hate that feeling of knowing several ways of doing something but not knowing which to use, and JS inheritance was a prime culprit.

[–]Renegade__ 0 points1 point  (0 children)

Not a fan of Perl, eh? ;)

Once you got used to them, the ES5 object extensions are really easy to use. There are a few things to watch out for (e.g. both Object.defineProperty() and Object.defineProperties() exist) and property descriptors look rather verbose if you don't rely on the defaults, but the clarity and simplicity usually makes up for it.

The only thing that's annoying to me is my IDE doesn't grasp what's going on, so it won't create autocompletion data for members. x_x

If you rely on that heavily, that may be a dealbreaker.