# 1. sort()

`var numbers = ['two', 'three', 'four'];// Sort from shortest to longest.numbers.sort((a, b) => a.length.compareTo(b.length));print(numbers);  // [two, four, three]`
`List<int> nums = [12, 2, -2, -11];nums.sort();print(nums);  // [-11,-2, 2, 12]`

# 2.toSet()

`List<int> nums = [13, 2,2,5,9,13,13,-11, -11];nums.toSet();print(nums);  // [13,2,5,9,-11]`

# 3.skip(),take()

`var myList = [13,8, 2,9,12, -11];var firstThreeOfMyList = myList.take(3)print(firstThreeOfMyList);  // [13, 8, 2]`

# 4.fold()

`dynamic fold(var initialValue,             dynamic combine(var previousValue, E element));List<int> nums = [13, 2, 5,7,-2];//get initial value as 0var sumOfnums = nums.flod(0,(sum,next)=>sum+next);print(sumOfnums) //`

# 5.indexOf()

`var students= ['John', 'Jane' , 'Magi','Nimal','Mala'];print(students.indexOf('Magi')); // 2`

# 6. contains()

`List<int> nums = [13, 2, 5,7,-2];print(nums.contains(2)) // trueprint(nums.contains(9)) //false`

# 7.forEach()

`List<int> nums = [13, 2, 5,7,-2];nums.forEach((number)=>print(nums)); // 13 2 5 7 -2`

--

--