Basically can I do the following...
var obj = {}:
obj.falsey = true;
if(obj){
//code not executed
}else{
//code executed
}
I could ta
You can borrow a false Number
,Boolean
.... from an iframe and extend its prototype.
Basically the following doesn't work because Numbers are a primitive value.
var x = 0;
x.test = 'yo';
console.log(x.test);
This does, but obviously this pollutes the Number.prototype, so you should really borrow a different Number
object from another iframe.
var x = 0;
Number.prototype.test = 'yo';
console.log(x.test);
Ultimately, just not a very good idea.