Filter a list element starting with a letter in JavaScript
<p>I am trying to sort out list elements that starts with 'N' into a new list.
Why won't this work?</p>

<pre><code>const countries = ['Norway', 'Sweden',  'Denmark', 'New Zealand'];

function firstN(){
  for (let i=0;i&lt;countries.length;i++){
    countries[i].startsWith("N")
    }
}

let startsWithN = countries.filter(firstN())
</code></pre>