Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to create a class javascript

class Person {
	constructor(name, age) {
		this.name = name;
		this.age = age;
	}
	displayInfo() {
		return this.name + ' is' + this.age + " years old";
	}
}

const Anthony = new Person('Anthony', 32);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #create #class #javascript
ADD COMMENT
Topic
Name
1+3 =