It seems as if there's two different ways to refer to the ... punctuator. How should I refer to this:
const foo = [bar, ...baz]; MDN seems to suggest it's referred to as 'spread syntax' but its article URL seems to suggest it was initially created under the name 'spread operator' -- and it's more popular when looking at Google results. Syntax is the 'form' of the language while operators are generally used to perform a certain operation on a number of operands to produce a value. It seems as if on the surface, 'operator' is the most appropriate fit here, as it's seems more like a prefix unary operator more than it is syntax. But in the context of ECMAScript, it's not listed as an operator at MDN nor explicitly in the language specification -- and it's more of an extension of array literal syntax and only works in context of array literals. I would say it's more appropriately named syntax due to that, in the language specification, it's only ever mentioned literally in the ArgumentList and SpreadELement productions. That seems to suggest it's more just syntax rather than a standalone operator such as + or *. Which way of referring to it would be more 'correct' if any and is my reasoning correct?
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

