Pepper Cloud interview question

How do you define a class in javascript?

Interview Answer

Anonymous

Dec 11, 2019

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