Dart Programming – Updating the Index

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
Dart Programming Updating the index

In this guide, we will discuss Updating the Index in Dart Programming Language. Dart allows modifying the value of an item in a List. In other words, one can re-write the value of list item. The following example illustrates the same −

void main() { 
   List l = [1, 2, 3]; 
   l[0] = 123; 
   print(l); 
}

The above example updates the value of the List item with index 0. The output of the code will be −

[123, 2, 3]

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply