Skip to content

Instantly share code, notes, and snippets.

@russiann
Created May 31, 2016 11:26
Show Gist options
  • Save russiann/153a21625dae172160f74c17ede8236e to your computer and use it in GitHub Desktop.
Save russiann/153a21625dae172160f74c17ede8236e to your computer and use it in GitHub Desktop.
Challenge
let foo = { val: 10 };
let bar = { val: 20 };
function magic(a, b) {
let first = a;
let second = b;
first.val = 30;
second.val = 10;
return (first.val + second.val);
}
let result = magic(foo, bar);
let total = (foo.val + bar.val);
console.log(result + total);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment