Question: Without re-writing the Rabbit class, add code as shown below to override the Rabbit prototype's properties so that the code in the blue box
Without re-writing the Rabbit class, add code as shown below to override the Rabbit prototype's properties so that the code in the blue box prints out: The rabbit of type killer says 'Hello World!' class Rabbit { constructor(type) { this.type = type; } speak(line) { console.log('The ${this.type} rabbit says '${line}'`); } } //your code goes here let killerRabbit = new Rabbit("killer"); killerRabbit.speak("Hello World!");
Step by Step Solution
There are 3 Steps involved in it
The challenge presented in the image is to modify the behavior of a Rabbit class without directly re... View full answer
Get step-by-step solutions from verified subject matter experts
