Generation

translateMon, 03 Jul 2023

function makeSandwich (topping) { return function (filling) { return topping + ' and ' + filling } } const chickenBacon = makeSandwich('Chicken') const beefEgg = makeSandwich('Beef') chickenBacon('Bacon') // => 'Chicken and Bacon' beefEgg('Egg') // => 'Beef and Egg'

function makeSandwich (topping) { return function (filling) { return topping + ' and ' + filling } } const chickenBacon = makeSandwich('Chicken') const beefEgg = makeSandwich('Beef') chickenBacon('Bacon') // => 'Chicken and Bacon' beefEgg('Egg') // => 'Beef and Egg'

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant