Created
March 13, 2019 02:11
-
-
Save chooyan-eng/509fb7d1edf055a8359160bc6e44b131 to your computer and use it in GitHub Desktop.
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
void main() { | |
var nums1 = [1, 2, 3]; | |
nums1[1] = 99; // valid | |
print(nums1[1]); | |
const nums2 = [1, 2, 3]; | |
nums2[1] = 99; // invalid: runtime error | |
print(nums2[1]); | |
var nums3 = const [1, 2, 3]; | |
nums3[1] = 99; // invalid: also runtime error (not compile-time error???) | |
print(nums3[1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment