Skip to content

Instantly share code, notes, and snippets.

@ddeveloperr
Created April 1, 2015 09:30
Show Gist options
  • Save ddeveloperr/4df32daf269fa381d0f2 to your computer and use it in GitHub Desktop.
Save ddeveloperr/4df32daf269fa381d0f2 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.
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