Determines the maximum of two given numbers - Node.js Number

Node.js examples for Number:Compare

Description

Determines the maximum of two given numbers

Demo Code


/**//from   ww  w . j av  a  2s.co m
 * Determines the maximum of two given numbers
 * @addon
 * @param {Number} A a number
 * @param {Number} B another number
 * @return the maximum of A and B
 * @type Number
 */
Number.max = function(A, B) {
  return (A > B)? A : B;
};

Related Tutorials