title: Getting only first key in for loop when calling some function inside it in JavaScript
body: <p>I have a function <code>CellDisplay</code>. Calling this function in another function <code>forLaunch</code>, this <code>forLaunch</code> function is getting called again in a loop <code>Obj.forEach</code> which consist of array of object. If I log the key <code>console.log(key)</code> in the <code>forLaunch</code> function it's showing only first key. I need all the key to display. Here is the code below</p>
  <h2>Javascript</h2>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const CellDisplay = item =&gt; {
    switch (item) {
      case 'item1':
        return 'one';
      case 'item2':
        return 'two';
      case 'item3':
        return 'three';
      case 'item4':
        return 'four';
      case 'item5':
        return 'five';
    }
  };
  const forLaunch = lData =&gt; {
    for (const key in lData) {
      console.log(key);
      return CellDisplay(key);
    }
  }
  
  const Obj = [{
    Id: 575,
    items: {
      item1: '2020-12-08T10:00:00.000+0000',
      item2: '2020-11-12T00:00:00.000+0000',
      item3: '2020-12-08T10:00:00.000+0000',
      item4: null,
      item5: '2020-12-08T10:00:00.000+0000'
    },
    active: false
  }];
  Obj.forEach(data =&gt; {
    forLaunch(data.items);
  });</code></pre>
  </div>
  </div>
  </p>