default class constructoer in jvacsript code example
Example 1: javascript class constructor
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
const person = new Person("John Doe", 23);
console.log(person.name); // expected output: "John Doe"
Example 2: how to create class in javascript
class ClassName
{
}