tc39 / proposal-partial-application

Proposal to add partial application to ECMAScript
https://tc39.es/proposal-partial-application/
BSD 3-Clause "New" or "Revised" License
1.02k stars 25 forks source link

There is an error in example ? #26

Closed a1mersnow closed 5 years ago

a1mersnow commented 6 years ago
let o = { f(x, y) { return x + y + this.z; }, z: 0 };

const g = o.f(?, 3);
g(1); // 4

// replace the value of `o`
o = { f(x, y) { return x + y + this.z; }, z: 2 };
g(1); // 6

// replace the value of `o.f`
o.f = (x, y) => x * y;
g(1); // 5

the last one should be 3 ?

rbuckton commented 5 years ago

This example was removed in a recent update. Current examples should be clearer.