Skip to content

Instantly share code, notes, and snippets.

@pycraft114
Created August 13, 2017 06:30
Show Gist options
  • Save pycraft114/7cbd652789d9be1effac807ffad8815f to your computer and use it in GitHub Desktop.
Save pycraft114/7cbd652789d9be1effac807ffad8815f to your computer and use it in GitHub Desktop.
Call by sharing example 2
function test(a, b){
a.value = 70;
b = b * 20;
}
var firstArg = { age: 10 };
var secondArg = 30;
test(firstArg, secondArg);
console.log(firstArg);
console.log(secondArg);
/*
out put
firstArg = { age: 70 };
secondArg = 30;
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment