@Exit/

JS 14 Exercise Two

Nodejs

fork
loading
Files
  • index.js

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.465734780943341","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"ZnVuY3Rpb24gZXhlcmNpc2VUd28oQW5pbWFsQ2xhc3MpewogIC8vIEV4ZXJjaXNlIFR3bzogSW4gdGhpcyBleGVyY2lzZSB5b3UgYXJlIGdpdmVuIGEgY2xhc3MgY2FsbGVkIEFuaW1hbENsYXNzLgogIC8vIFRoZSBjbGFzcyB3aWxsIGFscmVhZHkgaGF2ZSB0aGUgcHJvcGVydGllcyAnbmFtZScsICdub2lzZScgb24gaXQuCiAgLy8gWW91IHdpbGwgYmUgYWRkaW5nIGEgbWV0aG9kIHRvIHRoZSBwcm90b3R5cGUgY2FsbGVkICdzcGVhaycKICAvLyBVc2luZyB0aGUgJ3RoaXMnIGtleXdvcmQsIHNwZWFrIHNob3VsZCByZXR1cm4gdGhlIGZvbGxvd2luZyBzdHJpbmc6CiAgLy8gJzxuYW1lPiBzYXlzIDxub2lzZT4nCiAgLy8gRE8gTk9UIGNyZWF0ZSBhIG5ldyBjbGFzcyBvciBvYmplY3QKICBBbmltYWxDbGFzcy5wcm90b3R5cGUuc3BlYWsgPSBmdW5jdGlvbigpCnsgIAogIHRoaXMuc3BlYWsgPSBuYW1lICsgJ3NheXMnIG5vaXNlOwogcmV0dXJuIHRoaXMuc3BlYWsgOwp9CiAgLy8gUGxlYXNlIHdyaXRlIHlvdXIgY29kZSBpbiB0aGUgbGluZXMgYWJvdmUKICByZXR1cm4gQW5pbWFsQ2xhc3MKfQ=="},"asBuffer":null},"loaded":true}}
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