|
|
|
|
|
by littlecranky67
1109 days ago
|
|
Shouldn't have made an example in the if-statement as it is mostly useless there. But triple ! is very common to negate-and-convert a possibly falsy statement (undefined, null, false/true): const x: boolean | undefined | null = getValue();
const not_x: boolean = !!!y I added TS type annotation for clarity, although could be inferred if `getValue` is typed accordingly. |
|