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.
classMyBookextendsBook{/** * Class Constructor * * @param title The book's title. * @param author The book's author. * @param price The book's price. **/// Write your constructor hereconstructor(title,author,price){super(title,author)this.price=price}/** * Method Name: display * * Print the title, author, and price in the specified format. **/// Write your method heredisplay(){console.log(`Title:${this.title}\nAuthor:${this.author}\nPrice:${this.price}`)}// End class}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 13: Abstract Classes
You are viewing a single comment's thread. Return to all comments →
javascript