Fixed max for good
This commit is contained in:
@ -5,12 +5,7 @@ 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);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
Reference in New Issue
Block a user