function f1()
{
const v : string = String();
if(v) {alert("IF");} // OK
const b : boolean = v; // Type 'string' is not assignable to type 'boolean'.
if(b) {alert("BOOLEAN");}
}
f1();
My approach to this issue involves using the double exclamation mark, but I have a feeling that there might be complications ahead - or am I mistaken?
const b : boolean = !!v; //OK
I'm following this guide as my reference.