September 2019
Beginner
512 pages
12h 52m
English
Dart has optional typing, as you already know, so type checking operators may be handy for checking types at runtime:
The output of this code will be different depending on the context of the execution. In DartPad, the output is true for the check of the double type; this is due to the way JavaScript treats numbers and, as you already know, Dart for the web is precompiled to JavaScript for execution on web browsers.
There's also the as keyword, which is used for typecasting from a supertype to a subtype, such as converting num into int.
Read now
Unlock full access