Skip to content

Instantly share code, notes, and snippets.

@elevenpassin
Created October 25, 2017 17:25
Show Gist options
  • Save elevenpassin/06a80a0cd895ff7f158094532d624999 to your computer and use it in GitHub Desktop.
Save elevenpassin/06a80a0cd895ff7f158094532d624999 to your computer and use it in GitHub Desktop.
/*
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
}
/*
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