The challenge I am on ( https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function/ ) clearly states that " the class
syntax is just a syntax, and not a full-fledged class based implementation of object oriented paradigm, unlike in languages like Java, or Python, or Ruby etc."
MDN Web Docs state " JavaScript classes, introduced in ECMAScript 2015, are primarily syntactical sugar over JavaScript’s existing prototype-based inheritance. The class syntax does not introduce a new object-oriented inheritance model to JavaScript."
I have some basic understanding of OOP due to beginner knowledge of Java. I would like a bit of clarity here. Why is JS not an OOP? I read somewhere that JS is “Prototype based Programming (PBP)”. Another medium article suggested it is an OOP (link : https://medium.com/background-thread/why-javascript-is-an-oop-language-even-though-it-doesnt-have-classes-92a4e202176f).
At this point I am very confused, and would really appreciate some clarity on the matter.
- Is JS OOP or PBP? Why?
- Optional : how are these different?
Thank you.