Can you not use function variables inside another function's associated code?
<p>In the code exercise at Codecademy[1], it asks you to cube a variable and I can easily do that using:</p>

<pre><code>// Accepts a number x as input and returns its square
function square(x) {
  return x * x;
}

// Accepts a number x as input and returns its cube
function cube(x) {
  return x * x * x;
}

cube(7);
</code></pre>

<p>My question is for the cube function, why do I get a <code>NaN</code> error when I use the following code instead:</p>

<pre><code>function cube(x) {
  return x * square;
}
</code></pre>

<p>[1] <a href="http://www.codecademy.com/courses/functions_in_javascript/0#!/exercise/1" rel="nofollow">http://www.codecademy.com/courses/functions_in_javascript/0#!/exercise/1</a></p>
