📜  isfinite javascript 代码示例

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

代码示例1
function div(x) {
  if (isFinite(1000 / x)) {
    return 'Number is NOT Infinity.';
  }
  return 'Number is Infinity!';
}

console.log(div(0));
// expected output: "Number is Infinity!""

console.log(div(1));
// expected output: "Number is NOT Infinity."