Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js class

class ClassMates{
	constructor(name,age){
    	this.name=name;
      	this.age=age;
    }
}
const classmate = new ClassMates("Mohamed",16);
console.log(classmate.name);//output Mohamed
console.log(classmate.age);//output 16
 
PREVIOUS NEXT
Tagged: #js #class
ADD COMMENT
Topic
Name
9+3 =