Skip to content

Instantly share code, notes, and snippets.

@leonus96
Created October 26, 2023 01:07
Show Gist options
  • Save leonus96/5300f038f8ef2695a1c98d8fdb655bde to your computer and use it in GitHub Desktop.
Save leonus96/5300f038f8ef2695a1c98d8fdb655bde to your computer and use it in GitHub Desktop.
for-in
void main() {
///FOR -IN:
///final List<int> numeros = [1, 3, 4, 6, 2, 37, 1, 4];
/// For Convencional
/* for(int i = 0; i < numeros.length; i++) {
print(numeros[i]);
}*/
/// For in:
/*for (int numero in numeros) {
print(numero);
}*/
final List<String> alumnos = [
'Joseph',
'Jean Pierre',
'Axel',
];
for(String alumno in alumnos) {
print(alumno);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment