Skip to content

Instantly share code, notes, and snippets.

@chooyan-eng
Created March 13, 2019 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chooyan-eng/509fb7d1edf055a8359160bc6e44b131 to your computer and use it in GitHub Desktop.
Save chooyan-eng/509fb7d1edf055a8359160bc6e44b131 to your computer and use it in GitHub Desktop.
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