Use class Syntax to Define a Constructor Function, ES6 tutorial, Learn ES6 Syntax

preview_player
Показать описание
In this lesson, we look at a new way of writing constructor functions. In the past, the constructor function used the famous function keyword. As we have been observing in previous lessons, ES6 has made great efforts to save us time when typing, and that long 8 letter word (function) has been removed from many other places. It is only logical that here too we remove that keyword. We also are introduced to that word which is popular in other languages. class. As noted in the lesson, the class syntax we learn is just syntax. It is not like python's, or ruby's full class-based implementation of object-oriented paradigms. (Or any of the many other languages that use such implementations.)
Рекомендации по теме