Created
May 31, 2016 11:26
-
-
Save russiann/153a21625dae172160f74c17ede8236e to your computer and use it in GitHub Desktop.
Challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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