how to declare a more than function in javascript class code example
Example 1: javascript classes
class SayHelloTo {
name (to) {
console.log(`Hello ${to}`);
}
constructor (to) {
this.name(to);
}
}
const helloWorld = new SayHelloTo(World);
Example 2: es6 class example
var Polygon = class {
constructor(height, width) {
this.height = height;
this.width = width;
}
}