Created
October 14, 2016 13:15
-
-
Save ypetya/6a9048c8d6bddb5dfb89725643bad3aa to your computer and use it in GitHub Desktop.
bind freezing this
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
var a = function(a,b,c){ console.log( this.toString(),a,b,c); } | |
a(1,2,3) | |
// => [object Window] 1 2 3 | |
var b = a.bind(1,2) | |
b(3,4) | |
// => 1 2 3 4 | |
var c = b.bind(3,4) | |
c(5,6) | |
// => 1 2 4 5 | |
b === c | |
// => false | |
b == c | |
// => false | |
b === a | |
// => false | |
a.prototype // => Object | |
b.prototype // => undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment