Falsy
NonNull
NullOrNotEmpty
Nullish
NumberSet
ObjectMap
Optional
OptionalBoolean
OptionalDate
OptionalDomElement
Falsy
OptionalNumber
OptionalPropertyKey
OptionalSet
OptionalString
Truthy
Primitive
PropertyKeyRecord
PropertyKeySet
StringRecord
StringSet
Truthy
Tests for Falsy by simply applying negation ! to the tested val.
The value is mostly in added type-information and explicitly,
but in case of this simple type much the same can often be archived by just using negation !:
Tests for Nullish by simply comparing val for equality with null.
Clarification: TypeScript overloads this operator to produce TypeScript types if used in context of types.
The value to be tested
If val is primitive. If used in the flow of the program typescript will infer type-information from this.
Tests for Truthy value
The value is mostly in added type-information and explicitly
but in case of this simple type much the same can often be archived by just using double negation !!:
DomElement
Type representing [
DomElement]