1'use strict'
2class Polygon {
3 constructor(height, width) {
4 this.h = height;
5 this.w = width;
6 }
7 test() {
8 console.log("The height of the polygon: ", this.h)
9 console.log("The width of the polygon: ",this. w)
10 }
11}
12
13//creating an instance
14var polyObj = new Polygon(10,20);
15polyObj.test();
1let Person = class {
2 constructor(firstName, lastName) {
3 this.firstName = firstName;
4 this.lastName = lastName;
5 }
6}