is there any way to store a function call in a var ? if so i could save a 100s of lines in my code

function heads(){
document.write("heads")
}
function tails(){
document.write("tails")
}
function banana(){
document.write("banana")
}
function apple(){
document.write("apple")
}

if (choice == 1){
var A = apple()
var B = banana()
}
if (choice == 2){
var A = heads()
var B = tails()
}

Dice = Math.ceil (Dice * 2)

if (Dice == 1){
A
}
else if (Dice == 2){
B
}

the point with this is i can just change what A and B = and reuse the "if Dice" otherwise i need to make an "if" for every time i want to run it with different thing
Disclaimer i know with only 2 vars there is not much point to this but any more and the script will be samaller by doing this