Skip to content

Instantly share code, notes, and snippets.

@kdubbels
Created August 18, 2020 17:19
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 kdubbels/4bb5ddd07dfe618f645a832355508304 to your computer and use it in GitHub Desktop.
Save kdubbels/4bb5ddd07dfe618f645a832355508304 to your computer and use it in GitHub Desktop.
Write a function min that takes two arguments and returns their minimum.
// Write a function min that takes two arguments and returns their minimum.
const minimum = (num1, num2) => num1 > num2 ? num2 : num1
minimum(1,300) // 1
minimum(-1,300) // -1
minimum(-1,-300) // -300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment