If Else

suggest change

Dart has if-else statements:

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

Dart also has a conditional (ternary) operator:

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

Feedback about page:

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



Table Of Contents