how to make method for class javascript code example
Example 1: javascript classes
let Person = class {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
}
Example 2: variables in js class
constructor(){
this.foo = bar
}