title: Cannot read property 'push' of undefined in javascript
body: <p>I am not understanding where is the problem with the code and I tried to debug it give me cannot read properly 'push' of undefined also it's showing that acc is undefined and can someone please explain to me the code because it's confusing me</p>
  <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 multiplyOddByTwo = (arr) =&gt; {
    return arr.reduce((acc, curr) =&gt; {
      if (curr % 2 == 0) {
        acc.push(curr);
      } else {
        acc.push(curr * 2)
      }
    }, [])
  }
  
  console.log(multiplyOddByTwo([1, 2, 3]));</code></pre>
  </div>
  </div>
  </p>