Pepper Cloud interview question

How do you define a class in javascript?

Interview Answer

Anonymous

11 Dec 2019

class someone { constructor(something){ this.variable = something; } printSomething(){ console.log(this.variable); } } const ramesh = new someone('ramesh'); ramesh.printSomething();