April 2017
Beginner to intermediate
378 pages
7h 57m
English
I am a guy who believes that JavaScript is an object-based programming language and not an object-oriented programming language, and I know quite a lot of people who disagree with me.
In vanilla JavaScript, we have functions, which act like a class and exhibit prototype-based inheritance. In TypeScript/ES6, we have the class construct:
class Person { name: string; constructor(personName: string) { this.name = personName; } getName { return "The Name: " + this.greeting; } } // somewhere else arvind:Person = new Person('Arvind');
In the preceding example, we have defined a class named Person and we are defining the class constructor, which accepts the name on initialization of the class.
To initialize the class, we will invoke the ...
Read now
Unlock full access