Created
June 21, 2019 21:37
-
-
Save creativecreatorormaybenot/a83ce59618c1323235b1062f00f84282 to your computer and use it in GitHub Desktop.
Lists of mixed types in Dart
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
main() { | |
var data = ["abcd", 34, "ef", false]; | |
int n = data[1]; | |
print(n*2); // -> 68 | |
var otherData = [34, "abcd", "ef", false]; // -> type error | |
int m = otherData[1]; | |
print(m*2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment