title: JS simple function in function won't work
body: <p>I wanted to make this 1 function and call it in function 2.</p>
  
  <pre><code>function d6Roll(){
              var d6 = 1 + Math.floor(Math.random() * 6);
              }
  function attackModifier(){
                  d6Roll();
                  var aMod = d6;
                  document.getElementById("rezultatD6").innerHTML = aMod;
              }
  </code></pre>
  
  <p>For some reason it works only like this:</p>
  
  <pre><code>function d6Roll(){
              var d6 = 1 + Math.floor(Math.random() * 6);
              document.getElementById("rezultatD6").innerHTML = d6;
              }
  </code></pre>
  
  <p>Is it possible that function can't go inside another function?</p>