Created
October 25, 2017 17:25
-
-
Save elevenpassin/06a80a0cd895ff7f158094532d624999 to your computer and use it in GitHub Desktop.
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
/* | |
A function that takes 2 arguments and returns their minimum. | |
*/ | |
function min(type='binary', a, b){ | |
switch (type){ | |
case 'binary': | |
return (a > b) ? b : (b > a ? a : a) | |
break; | |
default: | |
break; | |
} | |
} | |
module.exports = { | |
min : min | |
} |
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
/* | |
A function that takes 2 arguments and returns their minimum. | |
*/ | |
function min(type='binary', a, b){ | |
switch (type){ | |
case 'binary': | |
return (a > b) ? b : (b > a ? a : a) | |
break; | |
default: | |
break; | |
} | |
} | |
module.exports = { | |
min : min | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment