📜  javascript max - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:34.295000             🧑  作者: Mango

代码示例6
x = findMax(1, 123, 500, 115, 44, 88);

function findMax() {
  var i;
  var max = -Infinity;
  for (i = 0; i < arguments.length; i++) {
    if (arguments[i] > max) {
      max = arguments[i];
    }
  }
  return max;
}