var a = '';
if (a) {
console.log("True Value");
} else {
console.log("False Value");
}
The above code logs "False Value" for obvious reasons, I want to set variable 'a' to a empty value such that it return true when used with if and logs "True Value".
Setting 'a' to empty object/array works fine but, I also want to do comparison between two variables but that is not possible with objects as they are compared by reference and not value.
Also I can not change the if else condition as it handles many cases other than this.