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
In your case
console.log(!obj); will return false.
console.log(!obj);
because an object or an empty object is always a truthy.