title: Assign to variable with arrow function doesn't work properly
body: <p>I have problem with arrow functions in javascript. When I try</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;
          &lt;p&gt;Click the button to get the sum of the numbers in the array.&lt;/p&gt;
          &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
          &lt;p&gt;Sum of numbers in array: &lt;span id="demo"&gt;&lt;/span&gt;&lt;/p&gt;
          &lt;script&gt;
              var numbers = [1, 2, 3, 4];
  
              function myFunction() {
                   const result =
                      numbers.reduce(
                          (total, sum) =&gt; total + sum
                      );
                  document.getElementById("demo").innerHTML = result;
              }
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>it works ok. But when I try</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;
          &lt;p&gt;Click the button to get the sum of the numbers in the array.&lt;/p&gt;
          &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
          &lt;p&gt;Sum of numbers in array: &lt;span id="demo"&gt;&lt;/span&gt;&lt;/p&gt;
          &lt;script&gt;
              var numbers = [1, 2, 3, 4];
  
              function myFunction() {
                   const result = numbers =&gt;
                      numbers.reduce(
                          (total, sum) =&gt; total + sum
                      );
                  document.getElementById("demo").innerHTML = result;
              }
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>the <em>result</em> value is a string rather than a number. I tried different insertion options for parentheses, but it does not work for me. Where I am doing mistake?</p>