diff --git a/public/docs/_examples/toh-5/ts/app/hero.service.ts b/public/docs/_examples/toh-5/ts/app/hero.service.ts index c1cb8fa3e6..900d0da712 100644 --- a/public/docs/_examples/toh-5/ts/app/hero.service.ts +++ b/public/docs/_examples/toh-5/ts/app/hero.service.ts @@ -20,7 +20,7 @@ export class HeroService { // #docregion get-hero getHero(id: number) { return this.getHeroes() - .then(heroes => heroes.filter(hero => hero.id === id)[0]); + .then(heroes => heroes.find(hero => hero.id === id)); } // #enddocregion get-hero }