In the interest of code compression, I want to change instances of true
and false
to 1
and 0
, respectively. I won't do any strict boolean equals (like boolA === true
). Is this a safe thing to do?
For reference to my specific issue, I'm trying to implement a universal .equals()
method that appears on every object and can be given any other object:
Object.prototype.equals=function(o){function f(a,b){for(i in a){j=a[i]if(typeof j=="object"?!f(j,b[i]):j!=b[i])return!1}return!0}return f(this,o)&&f(o,this)}
My goal is to make this and a slew of other basic utilities each less than 140 bytes long so I can get my web apps to my users faster and charge them less data.