Created
March 28, 2016 14:12
-
-
Save snowmantw/b72520f2761124c485f8 to your computer and use it in GitHub Desktop.
This file contains 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
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