'use strict'
function myFunc() {
try {
var i = 0 / 0;
console.log("zero divide by zero",i)
var j = 8 / 0;
console.log("positive number divide by zero",j)
var k = -9/ 0;
console.log("negative number divide by zero",k)
}
catch (ex) {
console.log(ex)
}
}
myFunc()
Output:
zero divide by zero NaN
positive number divide by zero Infinity
negative number divide by zero -Infinity
No comments:
Post a Comment