1function div(x) {
2 if (isFinite(1000 / x)) {
3 return 'Number is NOT Infinity.';
4 }
5 return 'Number is Infinity!';
6}
7
8console.log(div(0));
9// expected output: "Number is Infinity!""
10
11console.log(div(1));
12// expected output: "Number is NOT Infinity."
13