Min of two value - Javascript Number Operation

Javascript examples for Number Operation:Number Algorithm

Description

Min of two value

Demo Code


function customMin(v1,v2) {
  if (v1 < v2) {
    return v1;/*w ww  .  jav  a  2s  .c  o m*/
  } else {
    return v2;
  }
}

console.log(customMin(0,10))
console.log(customMin(0,-10))

Related Tutorials