Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript class extends

class Parent {
	constructor(name){
      this.name = name;
    }
}

class Child extends Parent {
  	constructor(name, school){
    	super(name); // Super must be called before setting child options
      	this.school = school;
    }
}
 
PREVIOUS NEXT
Tagged: #javascript #class #extends
ADD COMMENT
Topic
Name
4+7 =