Skip to content

Instantly share code, notes, and snippets.

@ilio
Created August 28, 2017 12:46
Show Gist options
  • Save ilio/9266bd19ca7c040948291e9c0cd2fa7a to your computer and use it in GitHub Desktop.
Save ilio/9266bd19ca7c040948291e9c0cd2fa7a to your computer and use it in GitHub Desktop.
javascript es6 min | max in array
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