title: Javascript - flatMap method over array - (flatMap is not a function)
body: <p>According to the Mozilla Developer Website:</p>
  <p><code>The flatMap() method first maps each element using a mapping function, then flattens the result into a new array. It is identical to a map followed by a flat of depth 1, but flatMap is often quite useful, as merging both into one method is slightly more efficient.</code></p>
  <p>Example:</p>
  <pre><code>let arr = [1, 2, 4, 2, 3, 3, 4, 5, 5, 5, 8, 8, 9, 10];
  
  const flatMap = arr.flatMap(x =&gt; x);
  console.log(flatMap);
  </code></pre>
  <p><code>TypeError: arr.flatMap() is not a function</code></p>
  <p>Why is this returning this error?</p>
  <p><strong>EDIT</strong></p>
  <p>I am running this through Atom text editor and have used HomeBrew to update it to the latest version using <code>brew upgrade node</code> and it is still giving me the same error.</p>
  <p>I have also tried <code>npm install n -g</code></p>