ES6 immediately invoked arrow function
<p>Why does this work in a Node.js console (tested in 4.1.1 and 5.3.0), but doesn't work in the browser (tested in Chrome)?</p>
<p>This code block should create and invoke an anonymous function that logs <code>Ok</code>.</p>
<pre><code>() =&gt; {
  console.log('Ok');
}()
</code></pre>
<p>Also, while the above <strong>works</strong> in Node.js, this does not work:</p>
<pre><code>n =&gt; {
  console.log('Ok');
}()
</code></pre>
<p>Nor this:</p>
<pre><code>(n) =&gt; {
  console.log('Ok');
}()
</code></pre>
<p>It is odd that when the parameter is added, it actually throws a <code>SyntaxError</code> at the immediately-invoking part.</p>