Fix max snippet
This commit is contained in:
@ -5,11 +5,6 @@ Returns the maximum value out of two or more numbers/arrays.
|
|||||||
Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
|
Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const max = (...arr) => Math.max(...[].concat(...arr);
|
const max = (...arr) => Math.max(...[].concat(...arr);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user