We know JavaScript class is based on prototype, but can someone explain how
different it is than the legacy class in other languages such as Java, Python, C#, PHP, etc. Don’t those languages search properties and methods from a base class (/super class /parent class /prototype, whatever you call it)?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just to confirm that you are aware of the ES6 Class support caniuse.com/#feat=es6-class
I do like this post, but "JavaScript does not support the concept of classes" is not a fact since time ago.
Please keep learning and don't stop posting!
I've come to the discuss section to see this kind of comment. Good pointing!
They're not really classes.
To quote the caniuse you posted:
ES6 classes are syntactical sugar to provide a much simpler and clearer syntax to create objects and deal with inheritance.
We know that, but the concept of Class exists, and can be used as classes are expected to be used.
Let's not confuse the syntax sugar with the inability to take advantage of them.
We know JavaScript class is based on prototype, but can someone explain how
different it is than the legacy class in other languages such as Java, Python, C#, PHP, etc. Don’t those languages search properties and methods from a base class (/super class /parent class /prototype, whatever you call it)?