Created
May 25, 2019 13:30
-
-
Save splincode/5d923ac28eeab35cfca54e6c468b36a7 to your computer and use it in GitHub Desktop.
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
function checkLanguage(greeter, closing){ | |
if (closing) { | |
const newGreeter = clone(greeter); | |
newGreeter.greeting = 'Goodbye'; | |
return newGreeter; | |
} | |
return greeter; | |
} | |
const foo = { greeting: 'Hello' }; | |
const newFoo = checkLanguage(foo, true); | |
console.log(newFoo.greeting + ' world!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment