Skip to content

Commit

Permalink
Merge pull request mbeaudru#11 from TrevorSayre/patch-1
Browse files Browse the repository at this point in the history
Fixed inheritance model language
  • Loading branch information
mbeaudru authored Sep 20, 2017
2 parents c2c2343 + 8620aa7 commit 4d95547
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ myBoundFunc("test") // "hello" -- myBoundFunc is person.myFunc with "hello" boun

### Class

JavaScript is a *prototype* oriented language (whereas Java is object oriented for instance). ES6 has introduced JavaScript classes which are meant to be a syntactic sugar for prototype-based inheritance and **not** a new object-oriented inheritance model ([ref](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)).
JavaScript is a [prototype-based](https://en.wikipedia.org/wiki/Prototype-based_programming) language (whereas Java is [class-based](https://en.wikipedia.org/wiki/Class-based_programming) language, for instance). ES6 has introduced JavaScript classes which are meant to be a syntactic sugar for prototype-based inheritance and **not** a new class-based inheritance model ([ref](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)).

The word *class* is indeed error prone if you are familiar with classes in other languages. If you do, avoid assuming how JavaScript classes work on this basis and consider it an entirely different notion.

Expand Down

0 comments on commit 4d95547

Please sign in to comment.