title: How can a variable be declared from passed loop parameter?
body: <p>Instead of doing this manually:</p>
  <pre><code>let test1 = echarts.init(document.getElementById('test1'));
  let test2 = echarts.init(document.getElementById('test2'));
  let test3 = echarts.init(document.getElementById('test3'));
  window.onresize = () =&gt; {
    test1.resize({
      height: 400,
      width: document.documentElement.clientWidth - 60,
    });
    test2.resize({
      height: 400,
      width: document.documentElement.clientWidth - 60,
    });
    test3.resize({
      height: 400,
      width: document.documentElement.clientWidth - 60,
    });
  };
  </code></pre>
  <p>I'd like to iterate through the array but <code>value</code> get an error, can't redeclare variable</p>
  <pre><code>const report = [
      'test1',
      'test2',
      'test3',
  ];
  
  report.forEach((value) =&gt; {
      value = echarts.init(document.getElementById(value));
      window.onresize = () =&gt; {
          value.resize({
          height: 400,
          width: document.documentElement.clientWidth - 60,
          });
      };
  });
  </code></pre>