How do you create an instance of a class in JavaScript?
class Person {
constructor(name) {
this.name = name;
}
}
const p = new Person('Ajay');
const p = Person('Ajay');
const p = createInstance(Person, 'Ajay');
const p = Object.create(Person);
This question is part of this quiz :
OOP in JavaScript