Loops: while, do while, and for

Dart supports the most common loop constructs, the for loop supports the for in notation and it can be used inside list/collection literals starting from Dart 2.3:

 var​ list1 = [
 for​(​int​ i = 0; i < 100; i++)
  i,
 ];
 var​ list2 = [
 for​(​var​ element ​in​ list1)
 "#​​$element​​"​,
 ];
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset