You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yasser Moradi edited this page Aug 26, 2015
·
2 revisions
Description:
The Union operator allows the items of two collections to be combined into a single resultant list.
If any duplicated items are identified, they are removed. This gives the same results
Distinct method and Concat method.
Sample:
letset1=['A','a','B','C','D','D','E'];letset2=['a','B','C','D','E','e','F'];letunion=set1.asEnumerable().union(set2,(a,b)=>a.toLowerCase()===b.toLowerCase()).toArray();console.log('Union method combines two list set1 and set2 as a unique list using comparer ...');for(varindex=0;index<union.length;index++)console.log(union[index]);