Skip to content

Instantly share code, notes, and snippets.

@ypetya
Created October 14, 2016 13:15
Show Gist options
  • Save ypetya/6a9048c8d6bddb5dfb89725643bad3aa to your computer and use it in GitHub Desktop.
Save ypetya/6a9048c8d6bddb5dfb89725643bad3aa to your computer and use it in GitHub Desktop.
bind freezing this
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