tc39 / proposal-bind-operator

This-Binding Syntax for ECMAScript
1.75k stars 30 forks source link

Split this into two operators? #45

Open fatcerberus opened 7 years ago

fatcerberus commented 7 years ago

As both a JS and C/C++ developer, :: confuses me. foo::bar in the current proposal means: bar.bind(foo) but I intuitively expect it to mean: foo.bar.bind(foo). So I would propose two operators, foo:::bar for the former, and foo::bar for the latter.

jackmahoney commented 7 years ago

Triple colon seems too ugly.

Alxandr commented 7 years ago

Not to mention to similar. It would be easy to read the code and not see the difference.

fatcerberus commented 7 years ago

Yeah, I see what you mean. My other idea was -> but that might get confused for an arrow function.