Is there any way to make an object return false in javascript?
var obj = new Object(); console.log(!!obj) // prints \"true\" even if it\'s empty
I think that with the first ! you are casting obj to a boolean and negating its value- resulting in true if obj is null - , and with the second ! negating it again.
!
true