Skip to content

Instantly share code, notes, and snippets.

@pycraft114
Last active August 13, 2017 06:29
Show Gist options
  • Save pycraft114/0ba5f287d0edb7bd871978ffe29b02d8 to your computer and use it in GitHub Desktop.
Save pycraft114/0ba5f287d0edb7bd871978ffe29b02d8 to your computer and use it in GitHub Desktop.
Call by sharing example 1
function test(a, b){
a = { something : "this is something" };
b.hello = "no greetings for you";
}
var firstArg = { hello : "hello world" };
var secondArg = { hello : "hello world" };
test(firstArg, secondArg);
console.log(firstArg, secondArg);
/*out put
{ hello: 'hello world' }
{ hello: 'no greetings for you' }
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment