title: JavaScript: How do I return two values from a function and call those two variables in another function?
body: <p>JavaScript:</p>
  
  <pre><code>                function getValue(){
                      var num1 = document.getElementById("firstNum").value;
                      var num2 = document.getElementById("secondNum").value;
  
                      return (num1, num2);
                  }
  
                  function add(){
                      getValue();
  
                      var result = parseFloat(num1) + parseFloat(num2);
  
                      return result;
                  }
  </code></pre>
  
  <p>What I'm creating is a calculator that gets the values from input boxes. What I'm having trouble with is how am I supposed to call the variables I declare in the getValue(); function in my add(); function to create a value.</p>
  
  <p>I appreciate the help.</p>