null

if

myNull

console

log

null is treated as false

);

var

zero

if

zero

console

log

0 is treated as false

);

In Dart, only the boolean value true is treated as true.

Try it out in DartPad.

Functions

Dart and JavaScript functions are generally similar.
The primary difference is the declaration.

// JavaScript

function

fn

()

return

true

Try it out in DartPad.

For more information, see the documentation on
functions.

Asynchronous programming

Futures