Skip to content

Instantly share code, notes, and snippets.

@Zambrella
Created October 22, 2019 21:42
Show Gist options
  • Save Zambrella/b3367e46172c430d069821f531e2050d to your computer and use it in GitHub Desktop.
Save Zambrella/b3367e46172c430d069821f531e2050d to your computer and use it in GitHub Desktop.
For Jesal
void main() {
Sample newSample = Sample();
print(newSample.counts);
void setToZero () {
// for (var i = 0; i < newSample.counts.length; i++) {
// newSample.counts[i] = 0;
// }
newSample.counts.forEach((i) => newSample.counts[i-1] = 0);
print(newSample.counts);
};
setToZero();
}
class Sample {
List counts = [1, 2, 3];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment