fix a small mistake in calling Math.max

This commit is contained in:
Bardia Rastin 2018-05-08 02:41:04 +04:30 committed by GitHub
parent 62a0bb597f
commit c42a4a749a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,7 +145,7 @@ alert( Math.max(arr) ); // NaN
*/!*
```
And surely we can't manually list items in the code `Math.max(arg[0], arg[1], arg[2])`, because we may be unsure how many there are. As our script executes, there could be a lot, or there could be none. And that would get ugly.
And surely we can't manually list items in the code `Math.max(arr[0], arr[1], arr[2])`, because we may be unsure how many there are. As our script executes, there could be a lot, or there could be none. And that would get ugly.
*Spread operator* to the rescue! It looks similar to rest parameters, also using `...`, but does quite the opposite.