loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.23668875753151353","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"Y2xhc3MgTGFuZ3VhZ2UgIHsKICAgY29uc3RydWN0b3IobmFtZSx2ZXJzaW9uKSB7CiAgICAgdGhpcy5uYW1lID0gbmFtZTsKICAgICB0aGlzLnZlcnNpb24gPSB2ZXJzaW9uOwogICB9CiAgIGhlbGxvKCkgewogICAgIHJldHVybiAiSGVsbG8gZnJvbSAiICsgdGhpcy5uYW1lOwogICB9Cn0KCi8vIENyZWF0ZSBvYmplY3QgaW5zdGFuY2VzIGZyb20gY2xhc3MKbGV0IGphdmFzY3JpcHQgPSBuZXcgTGFuZ3VhZ2UoIkphdmFTY3JpcHQiLCI1Iik7CmxldCBweXRob24gPSBuZXcgTGFuZ3VhZ2UoIlB5dGhvbiIsIjIuNyIpOwoKCi8vIFZlcmlmeSBwcm9wZXJ0eSB2YWx1ZSBhY2Nlc3MKY29uc29sZS5sb2coamF2YXNjcmlwdC5uYW1lKTsKY29uc29sZS5sb2coamF2YXNjcmlwdC52ZXJzaW9uKTsKY29uc29sZS5sb2coamF2YXNjcmlwdC5oZWxsbygpKTsKY29uc29sZS5sb2cocHl0aG9uLm5hbWUpOwpjb25zb2xlLmxvZyhweXRob24udmVyc2lvbik7CmNvbnNvbGUubG9nKHB5dGhvbi5oZWxsbygpKTsKCi8vIFByb3BlcnRpZXMgY2FuIGJlIGFkZGVkIHRvIGFuIG9iamVjdCBpbnN0YW5jZSBqdXN0IGxpa2UgaW4gRVM1IAovLyBZb3UgY2FuIGFkZCBhIHByb3BlcnR5IHRvIGFuIGluc3RhbmNlCnB5dGhvbi50eXBlZCA9ICdEeW5hbWljYWxseSc7CmNvbnNvbGUubG9nKHB5dGhvbi50eXBlZCk7Ci8vIEJ1dCB0aGUgamF2c2NyaXB0IGluc3RhbmNlIHdvbid0IGhhdmUgYSAndHlwZWQnIHByb3BlcnR5CmNvbnNvbGUubG9nKGphdmFzY3JpcHQudHlwZWQpOyAvLyB1bmRlZmluZWQKCi8vIFRoZSAncHJvdG90eXBlJyBpcyBhbHNvIGFjY2VzaWJsZSBsaWtlIGluIEVTNSBkYXRhIHR5cGVzCkxhbmd1YWdlLnByb3RvdHlwZS50eXBlZCA9ICJEeW5hbWljYWxseSI7Ci8vIE5vdyB0aGUgamF2YXNjcmlwdCBpbnN0YW5jZSBoYXMgYSAndHlwZWQnIHByb3BlcnR5LCBiZWNhdXNlIGl0IHdhcyBhZGRlZCB0byBpdHMgcHJvdG90eXBlCmNvbnNvbGUubG9nKGphdmFzY3JpcHQudHlwZWQpOw=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class Language  {
   constructor(name,version) {
     this.name = name;
     this.version = version;
   }
   hello() {
     return "Hello from " + this.name;
   }
}

// Create object instances from class
let javascript = new Language("JavaScript","5");
let python = new Language("Python","2.7");


// Verify property value access
console.log(javascript.name);
console.log(javascript.version);
console.log(javascript.hello());
console.log(python.name);
console.log(python.version);
console.log(python.hello());

// Properties can be added to an object instance just like in ES5 
// You can add a property to an instance
python.typed = 'Dynamically';
console.log(python.typed);
// But the javscript instance won't have a 'typed' property
console.log(javascript.typed); // undefined

// The 'prototype' is also accesible like in ES5 data types
Language.prototype.typed = "Dynamically";
// Now the javascript instance has a 'typed' property, because it was added to its prototype
console.log(javascript.typed);
Native Browser JavaScript