In the spirit of promoting technically accurate language, could we retag spread-operator to spread-syntax (except for the two cases mentioned below)?
The spread syntax refers to the JavaScript ES6 language feature (as noted by 75 out of 83 questions being tagged javascript), and because it is not a context-free grammar, it does not formally qualify as an operator. For more information on why this is so, see What is SpreadElement in ECMAScript documentation? Is it the same as Spread operator at MDN? and Is ...foo an operator or syntax?
Except for the two questions linked below, the rest of the questions that aren't tagged spread-operator+javascript are already tagged typescript, or already contain 5 other more relevant tags. You can check them out for yourself.
In contrast, Groovy and Kotlin do in fact have a spread operator, and both languages have a single question on Stack Overflow tagged spread-operator here and here respectively.
Adding a wiki for each [spread-*]
tag should clarify that spread-operator refers to the *.
infix binary operator in Groovy and *
prefix unary operator in Kotlin, while spread-syntax is to be used for ...
syntax in JavaScript.
I don't mean to be a language-lawyer, and I haven't even always felt this way, but I just think that as part of Stack Overflow's mission, we should be promoting the correct terminology. I've long since given up on the JSON object1 holy war, but this correction seems a lot less controversial to me.
Update
Here are the usage excerpts for each tag that I've suggested:
Please do not use this tag to refer to the spread syntax "..." in JavaScript. Use [spread-syntax] instead. In Groovy, the spread operator (*) is to extract entries from a collection and provide them as individual entries. This can be useful for converting collections to individual parameters on method calls. In Kotlin, the spread operator (*) allows a variable number of arguments (vararg) to be passed via the named form.
Please use this tag to refer to "..." in JavaScript. Spread syntax allows an iterable such as an array expression or string to be expanded in places where arguments for function calls, elements for array literals, or key-value pairs for object literals are expected.
1 See What is the difference between JSON and Object Literal Notation?
spread-operator
, the tagging UX should suggestspread-syntax
instead.