This is an interesting question and the in order to fully understand it would be beneficial to look into javascript expressions. Basically an assignment in javascript looks looks like
variable_name = expression
when you create that variable the expression is evaluated
//so this
number = 3 * 5
//is the same as
number = 15
Functions can be called with an expression, literal (like a string or int), or a variable name
// '|' means 'or'
function(expression | literal | variable)
if you pass an expression to a function function(expression), that expressionis first evaluated and then passed into the function.
// so
function(3*5)
//is the same as
function(15)
And the same thing goes for function calls. If a function is called inside another function, it is first evaluated and it's result is the outer functions argument.
Lets look at this example
function increment(number){
return number + 1
}
n = 1
document.write(increment(n))
First document.write is called with the parameter increment(n)
and n = 1
//so
increment(n) = increment(1) = 2
//following me? now we can see that
document.write(increment(n))
//is the same as
document.write(2)
//!!
I hope that helps!
edit:
to bring it back to your example
function multiNum(x,y){
return x*y
}
var num = multiNum(3,4) // num = 12
//so
document.write(num)
//is the same as
document.write(12)
a(b(c(42, c('x')))). This is harder to read (which closing parenthesis corresponds to the opening one?), and decomposing that into well-named variables will make everything much easier to maintain.