Update article.md

Wording of initial explanation of spread operator.
This commit is contained in:
paroche 2019-08-31 20:01:01 -06:00 committed by GitHub
parent e9ded79b03
commit ace9460329
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ alert( sum(1, 2, 3, 4, 5) );
There will be no error because of "excessive" arguments. But of course in the result only the first two will be counted.
The rest parameters can be mentioned in a function definition with three dots `...`. They literally mean "gather the remaining parameters into an array".
The rest of the parameters can be included in the function definition by using three dots `...` followed by the name of the array that will contain them. The dots literally mean "gather the remaining parameters into an array".
For instance, to gather all arguments into array `args`: