Re:Microsoft DeviceScript – TypeScript for Tiny IoT Devices
by eropple on Monday June 12, 2023 @05:07PM
(#36301142)
I've seen `!!` and I've seen `!`, but what would `!!!` get you here that the other two don't?
Re:Microsoft DeviceScript – TypeScript for Tiny IoT Devices
by littlecranky67 on Tuesday June 13, 2023 @05:23AM
(#36307667)
negation plus cast to boolean. See this for more info: https://stackoverflow.com/questions/21154510/the-use-of-the-...
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.