Skip to content

Instantly share code, notes, and snippets.

@wbamberg
Created April 10, 2013 22:42
Show Gist options
  • Save wbamberg/5359113 to your computer and use it in GitHub Desktop.
Save wbamberg/5359113 to your computer and use it in GitHub Desktop.
let { method } = require("sdk/lang/functional");
let myNumber = {
add: method(add),
number: 1
};
function add (target, x, y, z) { return target.number + x + y + z; }
console.log(myNumber.add(20, 10, 10)); // 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment