Skip to content

Instantly share code, notes, and snippets.

@danielpetrov
Created January 9, 2017 17:23
Show Gist options
  • Save danielpetrov/c36fdfeafa51980a80ec68320c8f2f51 to your computer and use it in GitHub Desktop.
Save danielpetrov/c36fdfeafa51980a80ec68320c8f2f51 to your computer and use it in GitHub Desktop.
Functional programming demos
function foo(bar) {
}
function foo(bar) {
var _bar = bar
}
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