Answers for "how to create instance of class in javascript"

0

how to create instance of class in javascript

class Hello {
	person(name){
    	this.name = name;
    }
  	// Constructor - Important except for JSX
    constructor(name){
    	this.person(name);
        console.log(`Hello ${this.name}`);
    }
}

const helloInstance = new Hello('john doe');
Posted by: Guest on September-20-2020

Code answers related to "how to create instance of class in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language