title: Passing variable from ForEach to addEventListener
body: <p>I'm trying to figure out how to pass a variable from my <code>forEach</code> loop into the <code>addEventListener('scroll')</code> method.</p>
  
  <p>Here is a fiddle :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>(function parallax() {
      let p = document.querySelectorAll('.js-parallax'),
          i = 0,
          m
  
      p.forEach(function (el, m) {  
          i % 2 == 0 ? m = 1 : m = 2
          i++
  
          console.log('m: ' + m + ' and i: ' + i)
  
          document.addEventListener('scroll', function(m) {
              console.log('And now m: ' + m + ' and i: ' + i)
          })
      });
  })()</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    min-height: 2000px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;div class="js-parallax"&gt;&lt;/div&gt;
    &lt;div class="js-parallax"&gt;&lt;/div&gt;
    &lt;div class="js-parallax"&gt;&lt;/div&gt;
    &lt;div class="js-parallax"&gt;&lt;/div&gt;
    &lt;div class="js-parallax"&gt;&lt;/div&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The idea is to work with a custom Parallax script where <code>m</code> is a multiplier and is different for one out of two item in <code>p</code>.
  I use first <code>i</code>, if it's odd, <code>m = 1</code> and if it's even <code>m = 2</code>.</p>
  
  <p>You'll see in the snippet console, <code>m</code> is fairly recognized within the loop but outside <code>addEventListener()</code>. Second console log output <code>m = [object Event]</code>. From here I'm kind of stuck.</p>
  
  <p>Any clue? Thanks in advance,</p>
  
  <p>A.</p>