|
|
|
|
|
by prodigal_erik
3474 days ago
|
|
In Python b = foo.bar
b()
correctly invokes the bar method of the foo object. In JavaScript, you have to write let b = foo.bar.bind(foo)
because foo.bar gives you a function (not a method) that doesn't remember which object it came from. |
|