class function constructor
class country{ constructor(name, independenceOn){ this.name = name this.independenceOn = independenceOn } describe = function () { console.log(this.name + " got its independence on " + this.independenceOn + " WHAHAHAHAH") } } const india = new country('The Country India', 1947) india.describe()
Declare Function In Class Constructor
class Person { constructor(name) { this.name = name; const xxx = async ()=> { alert("XXXXX"); } xxx(); } }