In JavaScript create an object called a monster class. The monster class should have a language argument string and a stomach represented by an array. The monster should support functions eat() and...


In JavaScript create an object called a monster class. The monster class should have a language argument string and a stomach represented by an array. The monster should support functions eat() and speak(). Class notation is needed to define the Monster's object interface. The eat() function will store whatever argument is passed to it and return what it has eaten. The speak() function will return the string passed to it.



After completing the above


Great an object called Gremlin that extends the Monster interface and takes the same argument.


The gremlin should:



  1. inherit how the monster eats

  2. speak differently in that any words passed as arguments to the monster above are replaced by the word "gar" which repeats based on the length of the string passed in monster speak() above.






Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here