Created
June 13, 2019 00:52
-
-
Save dariogabriel113/2fe3fc7840d69a3fa5d8be89403898b1 to your computer and use it in GitHub Desktop.
Dart | Language samples - Control flow statements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = 'Voyager I'; | |
var year = 1977; | |
var antennaDiameter = 3.7; | |
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune']; | |
var image = { | |
'tags': ['saturn'], | |
'url': '//path/to/saturn.jpg' | |
}; | |
if(year >= 2001) { | |
print('21st century'); | |
} else if (year >= 1901) { | |
print('20th century'); | |
} | |
for(var object in flybyObjects) { | |
print(object); | |
} | |
for(int month = 1; month <= 12; month++) { | |
print(month); | |
} | |
while(year < 2016) { | |
year += 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment