title: Use Array.map on an 2-dimensional Array
body: <p>So I have a 2-dimensional Array and want to use a "randomBool" function on each of the elements of the elements in the array. </p>
  
  <p>The "randomBool" function just returns a random boolean:</p>
  
  <pre><code>const randomBool = () =&gt; Boolean(Math.round(Math.random()));
  </code></pre>
  
  <p>this would be the 2-dimensional Array, that I would input:</p>
  
  <pre><code>var test = [
      ["just","some","random","text"],
      [1412,"test",1278391]
  ]
  </code></pre>
  
  <p>There is a working for-loop nested in a for-loop:</p>
  
  <pre><code>for (let el of test){
      for(let i in el){
          el[i] = randomBool();
      }
  }
  </code></pre>
  
  <p>I tried this: </p>
  
  <pre><code>test.forEach(el =&gt; el.map(el2 =&gt; randomBool()));
  </code></pre>
  
  <p>But it didn't work. Why?</p>