Skip to content

Instantly share code, notes, and snippets.

@mutoo
Created May 30, 2013 05:50
Show Gist options
  • Select an option

  • Save mutoo/5675933 to your computer and use it in GitHub Desktop.

Select an option

Save mutoo/5675933 to your computer and use it in GitHub Desktop.
min(a,b) and max(a,b) without ‘if statement’ in javascript
function min(a,b) {return a<b&&a||b;}
function max(a,b) {return a>b&&a||b;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment