title: Angular Tour of Heroes tutorial getHeroes() function
body: <p>I have a question regarding the getHeroes() functiion in the Heroes tutorial for Angular:</p>
  
  <pre><code>getHeroes(): void {
      this.heroService.getHeroes()
          .subscribe(heroes =&gt; this.heroes = heroes);
    }
  </code></pre>
  
  <p>can somebody explain to me what the syntax "<code>heroes =&gt; this.heroes = heroes</code>" is doing? I'm coming from java and python and have never seen such an expression</p>
  
  <p>the same goes for this:</p>
  
  <pre><code>&lt;ul class="heroes"&gt;
    &lt;li *ngFor="let hero of heroes"
      [class.selected]="hero === selectedHero"
      (click)="onSelect(hero)"&gt;
      &lt;span class="badge"&gt;{{hero.id}}&lt;/span&gt; {{hero.name}}
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>what is <code>[class.selected]="hero === selectedHero"</code> doing?</p>