0

console.log(typeof 3/0, Boolean(3/0)); // This returns NaN true
console.log(typeof 0/0, Boolean(0/0)); // This returns NaN false

I thought both will return NaN false in the Console as NaN is falsy value. But this is not happening. Can someone please explain this.

I used VS Code editor and Google Chrome Browser.

Yoshi
  • 54,081
  • 14
  • 89
  • 103
prabhakar
  • 385
  • 1
  • 2
  • 8

1 Answers1

1

The result of 3/0 is Infinity (which is not NaN).

Infinity is a thruty value by spec.

Julien
  • 2,256
  • 3
  • 26
  • 31