@Exit/

JS 14 Exercise Two

Nodejs

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function exerciseTwo(AnimalClass){
  // Exercise Two: In this exercise you are given a class called AnimalClass.
  // The class will already have the properties 'name', 'noise' on it.
  // You will be adding a method to the prototype called 'speak'
  // Using the 'this' keyword, speak should return the following string:
  // '<name> says <noise>'
  // DO NOT create a new class or object
  AnimalClass.prototype.speak = function()
{  
  this.speak = name + 'says' noise;
 return this.speak ;
}
  // Please write your code in the lines above
  return AnimalClass
}
node v10.16.0