In Typescript I can do this:
var xxx : some_type; if (xxx) foo(); else bar();
Here xxx will be treated as a boolean, regardless of its
You can use this trick which Typescript does allow and which works fine in JavaScript:
foo(!!xxx);
Alternatively, cast it to any
any
foo(xxx);