Merge pull request #1301 from paroche/patch-9

Update article.md
This commit is contained in:
Ilya Kantor 2019-09-01 11:37:37 +03:00 committed by GitHub
commit bbdb520e6b
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`: