Skip to content

Instantly share code, notes, and snippets.

@luqmaan
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luqmaan/8ebb0b17b9ce5d54d199 to your computer and use it in GitHub Desktop.
Save luqmaan/8ebb0b17b9ce5d54d199 to your computer and use it in GitHub Desktop.
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
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