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.
/* * Write code that adds an 'area' method to the Rectangle class' prototype */Rectangle.prototype.area=function(){returnthis.w*this.h;};/* * Create a Square class that inherits from Rectangle and implement its class constructor */classSquareextendsRectangle{constructor(side){super(side,side);}}
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 →