I am practicing error handling in Js, for this I have created an arrow function that takes 2 numbers as a parameter to return the quotient. It only returns NaN
let div = (n1,n2) => n1/n2
try {
if (isNaN(div(10/0))) {
throw new Error("no se puede dividir entre 0")
}
console.log(div((10/2)))
} catch (error) {
console.log(`Se produjo ${error}`)
} finally {
console.log("vuelva a intentarlo")
console.log(div(10/2))
}
the problem is that my function only returns NaN and the finally block should print 5