loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.07250621441269667","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"dmFyIExhbmd1YWdlID0gZnVuY3Rpb24obmFtZSx2ZXJzaW9uKSB7IAogdGhpcy5uYW1lID0gbmFtZTsKIHRoaXMudmVyc2lvbiA9IHZlcnNpb247CiB0aGlzLmhlbGxvID0gZnVuY3Rpb24oKSB7IAogICByZXR1cm4gIkhlbGxvIGZyb20gIiArIHRoaXMubmFtZTsKIH0KfTsKCi8vIENyZWF0ZSBvYmplY3QgaW5zdGFuY2VzIGZyb20gdGhlIHByb3RvdHlwZQp2YXIgamF2YXNjcmlwdCA9IG5ldyBMYW5ndWFnZSgiSmF2YVNjcmlwdCIsIjUiKTsKdmFyIHB5dGhvbiA9IG5ldyBMYW5ndWFnZSgiUHl0aG9uIiwiMi43Iik7CgoKLy8gVmVyaWZ5IHByb3BlcnR5IHZhbHVlIGFjY2Vzcwpjb25zb2xlLmxvZyhqYXZhc2NyaXB0Lm5hbWUpOwpjb25zb2xlLmxvZyhqYXZhc2NyaXB0LnZlcnNpb24pOwpjb25zb2xlLmxvZyhqYXZhc2NyaXB0LmhlbGxvKCkpOwpjb25zb2xlLmxvZyhweXRob24ubmFtZSk7CmNvbnNvbGUubG9nKHB5dGhvbi52ZXJzaW9uKTsKY29uc29sZS5sb2cocHl0aG9uLmhlbGxvKCkpOwoKCi8vIFlvdSBjYW4gYWRkIGEgcHJvcGVydHkgdG8gYW4gaW5zdGFuY2UKcHl0aG9uLnR5cGVkID0gJ0R5bmFtaWNhbGx5JzsKY29uc29sZS5sb2cocHl0aG9uLnR5cGVkKTsKLy8gQnV0IHRoZSBqYXZzY3JpcHQgaW5zdGFuY2Ugd29uJ3QgaGF2ZSBhICd0eXBlZCcgcHJvcGVydHkKY29uc29sZS5sb2coamF2YXNjcmlwdC50eXBlZCk7IC8vIHVuZGVmaW5lZAoKLy8gWW91IGNhbiB1c2UgJ3Byb3RvdHlwZScgdG8gYWRkIGEgcHJvcGVydHkgdG8gdGhlIHByb3RvdHlwZSAoaS5lLiB0byBhbGwgb2JqZWN0IGluc3RhbmNlcykKLy8gYWRkICd0eXBlZCcgcHJvcGVydHkKTGFuZ3VhZ2UucHJvdG90eXBlLnR5cGVkID0gIkR5bmFtaWNhbGx5IjsKLy8gTm93IHRoZSBqYXZhc2NyaXB0IGluc3RhbmNlIGhhcyBhICd0eXBlZCcgcHJvcGVydHksIGJlY2F1c2UgaXQgd2FzIGFkZGVkIHRvIGl0cyBwcm90b3R5cGUKY29uc29sZS5sb2coamF2YXNjcmlwdC50eXBlZCk7Cg=="},"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
var Language = function(name,version) { 
 this.name = name;
 this.version = version;
 this.hello = function() { 
   return "Hello from " + this.name;
 }
};

// Create object instances from the prototype
var javascript = new Language("JavaScript","5");
var 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());


// 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

// You can use 'prototype' to add a property to the prototype (i.e. to all object instances)
// add 'typed' property
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