Angular 2 TypeScript how to find element in Array

Source: https://stackoverflow.com/questions/37969984/angular-2-typescript-how-to-find-element-in-array
You need to use method Array.filter:
this.persons =  this.personService.getPersons().filter(x => x.id == this.personId)[0];
this.persons =  this.personService.getPersons().find(x => x.id == this.personId);

Không có nhận xét nào:

Is it okay to use both fetchpriority="high" and loading="eager" in img tag?

 https://stackoverflow.com/questions/77744344/is-it-okay-to-use-both-fetchpriority-high-and-loading-eager-in-img-tag Yes Fetchpriority and l...