loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.2968337714402156","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"LyoqCiAqIHBhc3MgYnkgdmFsdWUgZm9yIHByaW1pdGl2ZQogKi8KZnVuY3Rpb24gY2FsbE1lKG5hbWUsIGFnZSkgewogIG5hbWUgPSAndml2ZWsnOwogIGFnZSA9IDI2OwogIGNvbnNvbGUubG9nKCJ0aGUgbmFtZSBpczogIiArIG5hbWUgKyAiIGFuZCBhZ2UgaXM6ICIgKyBhZ2UpOwp9CgpsZXQgbmFtZSA9ICd2YWliaGF3JzsKbGV0IGFnZSA9IDIwOwoKY29uc29sZS5sb2coIkluaXRpYWwgdmFsdWVzIGFyZSBuYW1lOiAiICsgbmFtZSArICIgYW5kIGFnZTogIiArIGFnZSApOwoKY2FsbE1lKG5hbWUsIGFnZSkKY29uc29sZS5sb2coIkFmdGVyIGZ1bmN0aW9uIGNhbGwgbmFtZTogIiArIG5hbWUgKyAiIGFuZCBhZ2U6ICIgKyBhZ2UpOwoKLyoqCiAqIHBhc3MgYnkgcmVmZXJlbmNlIGZvciBvYmplY3QKICovCmZ1bmN0aW9uIGNhbGxNZU1heWJlKGFueVBlcnNvbikgewogIGFueVBlcnNvbi5uYW1lID0gJ3ZpdmVrJzsKICBhbnlQZXJzb24uYWdlID0gMjY7CiAgY29uc29sZS5sb2coImNhbGwgaGltPyBjYWxsIGhpbSBub3Q/IHRoZSBuYW1lIGlzOiAiICsgYW55UGVyc29uLm5hbWUgKyAiIGFuZCBhZ2UgaXM6ICIgKyBhbnlQZXJzb24uYWdlKTsKfQoKbGV0IHBlcnNvbiA9IHsKICAgIG5hbWU6ICd2YWliaGF3JywKICAgIGFnZToyMAp9OwoKY29uc29sZS5sb2coIkluaXRpYWwgdmFsdWVzIGFyZSBuYW1lOiAiICsgcGVyc29uLm5hbWUgKyAiIGFuZCBhZ2U6ICIgKyBwZXJzb24uYWdlICk7CgpjYWxsTWVNYXliZShwZXJzb24pCmNvbnNvbGUubG9nKCJBZnRlciBjYWxsaW5nIGZ1bmN0aW9uIG5hbWU6ICIgKyBwZXJzb24ubmFtZSArICIgYW5kIGFnZTogIiArIHBlcnNvbi5hZ2UpOw=="},"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
35
/**
 * pass by value for primitive
 */
function callMe(name, age) {
  name = 'vivek';
  age = 26;
  console.log("the name is: " + name + " and age is: " + age);
}

let name = 'vaibhaw';
let age = 20;

console.log("Initial values are name: " + name + " and age: " + age );

callMe(name, age)
console.log("After function call name: " + name + " and age: " + age);

/**
 * pass by reference for object
 */
function callMeMaybe(anyPerson) {
  anyPerson.name = 'vivek';
  anyPerson.age = 26;
  console.log("call him? call him not? the name is: " + anyPerson.name + " and age is: " + anyPerson.age);
}

let person = {
    name: 'vaibhaw',
    age:20
};

console.log("Initial values are name: " + person.name + " and age: " + person.age );

callMeMaybe(person)
console.log("After calling function name: " + person.name + " and age: " + person.age);
Native Browser JavaScript