Wednesday, April 3, 2019

use .includes in TypeScript

See if a match is in a collection!

private getBusinessUnitRecordsSuccess(records:Array){
   records.forEach(r => {
      if (this.user.BusinessUnitIds.includes(r.BusinessUnitID)){
         this.businessUnitRecords.push(r);
      }
   });
}

No comments:

Post a Comment