Created
August 28, 2017 12:46
-
-
Save ilio/9266bd19ca7c040948291e9c0cd2fa7a to your computer and use it in GitHub Desktop.
javascript es6 min | max in array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arr = [1,2,3] | |
const min = Math.min(...arr); | |
const max = Math.max(...arr); | |
console.log('min:', min, 'max:', max); // output => min: 1 max: 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment