-
Notifications
You must be signed in to change notification settings - Fork 3
Last
Yasser Moradi edited this page Aug 26, 2015
·
1 revision
Description:
This method is similar to first. However instead of returning the first item in a sequence it return last item.
Sample:
let items = ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'];
let last = items.asEnumerable().last();
console.log(last);
last = items.asEnumerable().last(item => item.length == 5);
console.log(last);