Document.write parameters?

About this code,
function addNumbers(a, b) {
var c = a+b;
return c;
document.write( addNumbers(40, 2) {
//Outputs 42

is there a way to simply say “document.write( var c)” or document.write(c ) if the parameters were given elsewhere and you already knew what c is?

In that case you you don’t even have to call addNumbers function. For ex:

var c = 10;