Created
January 9, 2017 17:23
-
-
Save danielpetrov/c36fdfeafa51980a80ec68320c8f2f51 to your computer and use it in GitHub Desktop.
Functional programming demos
This file contains 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 foo(bar) { | |
} | |
function foo(bar) { | |
var _bar = bar | |
} |
This file contains 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
var obj = {} | |
function foo(bar) { | |
bar = { | |
'newProperty': 25 | |
} | |
return bar | |
} | |
function foo2(bar) { | |
bar['newProperty'] = 26 | |
return bar | |
} | |
foo(obj)// ? | |
obj// ? | |
foo2// ? | |
obj// ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment