-
Notifications
You must be signed in to change notification settings - Fork 3
Contains
Yasser Moradi edited this page Sep 1, 2015
·
1 revision
Description:
This method returns true if a collection contains specific value. You can pass a custom comparer.
Sample:
let names = ['Art', 'Bob', 'Cath', 'Dan', 'Ian'];
console.log('has Cath => ' + names.asEnumerable().contains('Cath'));
console.log('has Jim => ' + names.asEnumerable().contains('Jim'));
console.log('has Cath => ' + names.asEnumerable().contains('cath'));
console.log('has cath => ' + names.asEnumerable().contains('cath', (a, b) => a.toLowerCase() == b.toLowerCase()));