Skip to content

Instantly share code, notes, and snippets.

@snowmantw
Created March 28, 2016 14:12
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 snowmantw/b72520f2761124c485f8 to your computer and use it in GitHub Desktop.
Save snowmantw/b72520f2761124c485f8 to your computer and use it in GitHub Desktop.
var Cube = function(width) {
this.width = width;
};
Cube.prototype.volume = function() {
return Math.pow(this.width, 3);
};
var cube = new Cube(4)
cube.volume = cube.volume.bind({ width: 3});
cube.volume.call({ width: 5});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment