title: When to use const or var or let and lambda expresion internals
body: <pre><code>groups= [];
  
  getGroup(id){
      const s = groups.find(t =&gt; t.id === id);
      return s;
  }
  
  getGroup(id){
      var s = groups.find(t =&gt; t.id === id);
      return s;
  }
  
  
  getGroup(id){
      let s = groups.find(t =&gt; t.id === id);
      return s;
  }
  </code></pre>
  
  <ol>
  <li>Is there any logic/reason to define <code>s</code> with <code>var</code> or <code>let</code> in such a situation?</li>
  <li>What does js do in background of the code in lambda expression?
  Does it keep the values of the <code>group</code> in some data struct that can handle this fast and avoid some <code>forEach</code> loop ? </li>
  </ol>