Answers for "isfinite javascript"

0

isfinite javascript

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."
Posted by: Guest on August-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language