tc39 / proposal-bind-operator

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

Can .. be used instead #10

Closed kenchris closed 8 years ago

kenchris commented 9 years ago

It looks more similar to . and Dart uses it as well.

Though it might be a problem with 1..toString()

zenparsing commented 9 years ago

Technically we could use "..", but I don't think it's visually distinct enough. We want it to look pleasing, but obviously different from property lookup.

zloirock commented 9 years ago

.. more interesting as cascade operator (forced return this) like in Dart or LiveScript.

[2, 7, 1, 8]
  ..push(3)
  ..shift()
  ..sort(); // => [1,3,7,8]
bmeck commented 9 years ago

Just remember that ... is the spread operator. Consider this:

[..other_fn_that_is_iterable]

vs

[...other_fn_that_is_iterable]
rymohr commented 9 years ago

Would have loved to use & over either of these but since that one's out my vote's for sticking with ::

Too much potential for confusion and I'd prefer to see .. reserved for ranges 1..10

zenparsing commented 8 years ago

Agreed, let's stick with ::.