Hi I am solving the JS coding test.
It is to know what is the output .
const number = undefined + 11;
if (number === NaN) {
document.write("NaN");
} else if (number === 11) {
document.write("11");
} else {
document.write("other");
}
I thought the output is the 'NaN' But the output is 'other'
Is anyone knows why the output is 'other'?
I checked with console.log(number) and it showed NaN .. I dont know why if statement shows 'other'
Thank you so much !