title: replacement for switch statements?
body: <p>Any way to replace this switch statement for object?</p>
  
  <pre><code> Object.keys(data).forEach(key =&gt; {
      switch (true) {
          case key === '1':
              Store.get1();
              return;
          case key === '2':
              get2();
              return;
          case key === '4':
              get4(4);
              return;
          case key === '5':
              get5({value1 = 5.value1, value2 = 5.value2});
              return;
          default:
              break;
      }
    })
  </code></pre>
  
  <p>to replace it with something like this: </p>
  
  <pre><code>       Object.keys(data).forEach(key =&gt; {
            const keyMap = {
          1: Store.get1(),
          2: get2(),
          3: get3(),
          4: get4(),
          5: get5({value1 = 5.value1, value2 = 5.value2}),
          };
          return keyMap[key];
  </code></pre>
  
  <p>but this way every function in keyMap just gets triggered every time.</p>
  
  <ol>
  <li>i need get2() without store, because its just a function in the upper scope.</li>
  <li>imagine 5 as an object 5: { value1: something, value2: something}</li>
  </ol>