Wrapping Up
JavaScript supports object-oriented programming, but unlike most of the other mainstream languages, it offers prototypal inheritance instead of class-based inheritance. The updated syntax for inheritance is similar to the one in Java, but the semantics remain true to the roots of JavaScript. It is much easier now to use inheritance and to override methods. The code is easier to understand and to maintain, and it is not prone to errors as it was in the past. Furthermore, you can directly and comfortably use inheritance instead of relying on libraries to do it for you. In addition to supporting inheritance, JavaScript provides a special symbol, species, that can be used to control the type of instance that’s created when working with ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access