access data inside of class javascript code example
Example 1: es6 class example
class Polygon {
constructor(height, width) {
this.height = height;
this.width = width;
}
}
Example 2: es6 class example
var Polygon = class {
constructor(height, width) {
this.height = height;
this.width = width;
}
}
Example 3: javascript classes
let Person = class {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
}