title: Printing results of function outside of the local scope
body: <p>I was wondering how to print the return value of my function outside of the scope of the function. I researched online and found the post below bu this just gave me arr is undefined. Can somebody please point me in the right direction?
  <a href="https://stackoverflow.com/questions/15694273/console-log-not-printing-variable-from-function">Console log not printing variable from function</a></p>
  
  <pre><code>function multiplyAll(arr) {
      var product = 1;
      for (var i = 0; i &lt; arr.length; i++) {
          for (var j = 0; j &lt; arr[i].length; j++)
              product = product * arr[i][j];
      }
      //why is the product undefined?
      return product;
  }
  //modify values below to test code
  multiplyAll([
      [60, 60],
      [24, 365]
  ]);
  
  //console.log("Print results of product" + product);
  </code></pre>