If Else

suggest change

Dart has If Else:

if (year >= 2001) {
  print('21st century');
} else if (year >= 1901) {
  print('20th century');
} else {
  print('We Must Go Back!');  

Dart also has a ternary if operator:

var foo = true;
print(foo ? 'Foo' : 'Bar'); // Displays "Foo".

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents