title: How to pass a variable down through a set of chained methods?
body: <p>I'm trying to chain several methods to clean up my code. Here is what I've done:</p>
  <pre><code>const playerItemDropUpdates = this.players.list
     .map(player =&gt; player.inventory.itemDropId)
     .filter((itemDropId): itemDropId is ItemId =&gt; itemDropId != null)
     .map(itemDropId =&gt; this.createItemDrop(itemDropId, player, 1));
  </code></pre>
  <p>Unfortunately, in the second <code>map</code> method (4th line), it says <code>cannot find name 'player'.</code></p>
  <p>How can I fix this and make <code>player</code> accessible in the second <code>map</code>?</p>