Monday, March 13, 2017

Use a lambda expression at a forEach in TypeScript!

childItems.forEach((childItem: MyType): void => {
   if (childItem.myStatus === 'Whatever') {
      matches++;
   }
});

 
 

...may replace:

childItems.forEach(function (childItem) {
   if (childItem.myStatus === 'Whatever') {
      matches++;
   }
});

No comments:

Post a Comment