@panzerdp/

PreciousGroundedJuliabutterfly

JavaScript

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6850092847311098","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"Y2xhc3MgR2FtZSB7ICAKICBjb25zdHJ1Y3RvcihuYW1lKSB7CiAgICB0aGlzLm5hbWUgPSBuYW1lOwogIH0KCiAgZ2V0TWVzc2FnZSgpIHsKICAgIHJldHVybiBgSSBsaWtlICR7dGhpcy5uYW1lfSFgOwogIH0KfQoKY29uc3QgZG9vbSA9IG5ldyBHYW1lKCdEb29tJyk7ICAKCmNvbnN0IGRvb21GdWxsQ2xvbmUgPSB7ICAKICAuLi5kb29tLAogIF9fcHJvdG9fXzogR2FtZS5wcm90b3R5cGUKfTsKCmNvbnNvbGUubG9nKGRvb21GdWxsQ2xvbmUgaW5zdGFuY2VvZiBHYW1lKSAvLyA9PiB0cnVlICAKY29uc29sZS5sb2coZG9vbUZ1bGxDbG9uZS5uYW1lKTsgICAgICAgICAgIC8vID0+ICJEb29tIiAgCmNvbnNvbGUubG9nKGRvb21GdWxsQ2xvbmUuZ2V0TWVzc2FnZSgpKTsgICAvLyA9PiAiSSBsaWtlIERvb20hIiAg"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Game {  
  constructor(name) {
    this.name = name;
  }

  getMessage() {
    return `I like ${this.name}!`;
  }
}

const doom = new Game('Doom');  

const doomFullClone = {  
  ...doom,
  __proto__: Game.prototype
};

console.log(doomFullClone instanceof Game) // => true  
console.log(doomFullClone.name);           // => "Doom"  
console.log(doomFullClone.getMessage());   // => "I like Doom!"  
Native Browser JavaScript