JSFiddle - React, Tailwind, and code Playground

by podlipensky

JavaScript

var a = {toString: function(){ return false; }};
if(a == !a){
 document.write('here');
 document.write('</br>');
}
document.write(+a);
document.write('</br>');
//toString method will be called and 'false' will be returned
document.write(a);
document.write('</br>');
//objects evaluated to boolean always return true, so !a will return false
document.write(!a);