Это то, что вы спрашиваете?
function add1(x){
return x + 1;
}
function mult2(x){
return x * 2;
}
function add1ThenMult2(x){
return mult2(add1(x));
}
add1ThenMult2(10); // --> 22
или, скрывая 2 функции ...
var add1ThenMult2 = (function(){
function add1(x){
return x + 1;
}
function mult2(x){
return x * 2;
}
function add1ThenMult2(x){
return mult2(add1(x));
}
return add1ThenMult2;
}());
add1ThenMult2(10); // --> 22