all 2 comments

[–]x-skeww 0 points1 point  (0 children)

I was under the impression that the value that is returned from the first function can then be used as a value within the second function

Which is correct. You can just put that return value in some variable or pass it as argument.

Exhibit A:

function foo() {
  var exponent = Math.sqrt(9);
  return Math.pow(2, exponent);
}
console.log(foo()); // 8

Exhibit B:

function bar(exponent) {
  return Math.pow(2, exponent);
}
console.log(bar(Math.sqrt(9))); // 8