-
Couldn't load subscription status.
- Fork 0
Asserts & Type Guards
Webber Wang edited this page Sep 21, 2020
·
6 revisions
Type guards are used for conditional statements. If we have a Factory function we will use type guards
if (isNodeReact) {}
else if (isNodeTree) {}Asserts on the other hand is used to narrow down the type for further statements.
isID casts the type from string string | undefined
Footer