DEV Community

Discussion on: Practical Ways to Write Better JavaScript

Collapse
 
taillogs profile image
Ryland G • Edited

Don't even get me started on the spread operator visual design. I think the fact that they didn't come up with a specific syntax and used the existing rest style is atrocious. They actually do opposite things, and are somehow controlled with the same literal. This is just off the top of my head. But why not:

function (...foo) { // before
  foo[0];
}

function (_>foo) { // after
  foo[0];
}
expanded = ...foo; // before
expanded = <_foo; // after