Search code examples
javascript-objects

Why does +!!{} equal to 1?


I understand that it has a typeof Number because of plus before it and that it is an empty object.

+!!{} === 1

Solution

  • ! of any (also the empty) object is false

    !false is true

    +true === 1