Created
August 18, 2020 17:19
-
-
Save kdubbels/4bb5ddd07dfe618f645a832355508304 to your computer and use it in GitHub Desktop.
Write a function min that takes two arguments and returns their minimum.
This file contains 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
// 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