We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Rectangle.prototype.area=function(){returnthis.w*this.h;}classSquareextendsRectangle{//The super() method refers to the parent class.// By calling the super() method in the constructor method, we call the parent's constructor method and gets access to the parent's properties and methods.constructor(width){super(width,width);this.width=width;}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 5: Inheritance
You are viewing a single comment's thread. Return to all comments →