Created
April 1, 2015 09:30
-
-
Save ddeveloperr/4df32daf269fa381d0f2 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. | |
var min = function(a,b) { | |
return (a <= b) ? a : b; | |
} | |
console.log(min(9, 101)); | |
// → 9 | |
console.log(min(55, -110)); | |
// → -110 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment