Last active
August 29, 2015 14:01
-
-
Save luqmaan/8ebb0b17b9ce5d54d199 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 add(a, b) { | |
console.log(a + b); | |
} | |
function diff(a, b) { | |
console.log(a - b); | |
} | |
function l(x, y) { | |
x(); | |
y(); | |
} | |
l(add.bind(null, 1, 2), diff.bind(null, 6, 2)) | |
// prints | |
// 3 | |
// 4 |
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
def add(a, b): | |
print a + b | |
def diff(a, b): | |
print a - b | |
def l(x, y, args, args2): | |
x(*args) | |
y(*args2) | |
l(add, diff, [1, 2], [6, 2]) | |
# prints | |
# 3 | |
# 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment