6 ms·
Fortunately, it seems to be convoluted as a result of its underlying simplicity, perhaps? The reason the article you linked is so long (instead of just being t
by kdmccormick 5y ago
Fortunately, it seems to be convoluted as a result of its underlying simplicity, perhaps?
The reason the article you linked is so long (instead of just being the standard OOP shallow- vs deep-copy disclaimer) seems to be because JS objects and classes are just dictionaries (in the Python sense of the word) with certain magic fields to control dispatch, inheritance, etc. The docs need to take care to explain how certain operations interact with those magic fields. So, still convoluted, but IMO better than if it were convoluted because everything was a built-in special case under the hood.
At least that's my impression as someone who doesn't write a lot of JS. Happy to be corrected.
- adt2bt 5y agoThat's also my impression as someone who used to write a lot of JS - everything is either a value, dict or array, and once you learn some guardrails on how you write JS code (in your words, 'explain how certain operations interact with those magic fields'), it becomes remarkably nice to use.