const cutFruit = function(fruit) { | |
return fruit * 4; | |
} | |
const makeJuice = function(apples, oranges) { | |
const applePieces = cutFruit(apples); | |
const orangePieces = cutFruit(oranges); | |
return `Juice with ${applePieces} pieces of apple and ${orangePieces} pieces of orange.`; | |
} | |
console.log(makeJuice(2, 3)); // Output: Juice with 8 pieces of apple and 12 pieces of orange. |