Dart Programming – List.last Method

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
Dart Programming list.last method

In this guide, we will discuss the List.last Method in Dart Programming Language. Returns the last element in the list.

Syntax

List.last 

Example

void main() { 
   var lst = new List(); 
   lst.add(12); 
   lst.add(13); 
   print("The last element of the list is: ${lst.last}"); 
}   

It will produce the following output −

The last element of the list is: 13 

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply