Skip to content

Instantly share code, notes, and snippets.

@Andreolle
Created April 5, 2019 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andreolle/b6fd8e6e34c2db4d75e18f9c38cd2438 to your computer and use it in GitHub Desktop.
Save Andreolle/b6fd8e6e34c2db4d75e18f9c38cd2438 to your computer and use it in GitHub Desktop.
Functions to find bigger or smallest number in passed args
const getSmallestNumber = (...nums) => Math.min(...nums)
const getBiggerNumber = (...nums) => Math.max(...nums)
// Ex:
// getSmallestNumber(2,1,5,2,6)
// = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment