codex-lv3-may-2025

Level Navigation: 1 (2ℹ️) 3 4 5 6 (7ℹ️) (8ℹ️) (9ℹ️) 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 (37ℹ️) 38⚡ 39⚡ 40⚡ 41⚡ 42 43⚡ 44⚡ 45 46 (47ℹ️)

Level 41 (Challenge): Compose Functions - Create a Full Greeting

Now that we have all three functions, let’s compose them together! Create a function that uses all three to create a decorated, signed greeting.

Function signature:

createFullGreeting(name, occasion, from)  string

Examples:

Your task:

  1. Write tests for createFullGreeting
  2. Implement it by calling your other three functions
  3. Think about the order: greeting → signature → decoration

Hint: You can call functions inside other functions:

function createFullGreeting(name, occasion, from) {
  const greeting = makeGreeting(name, occasion);
  const signed = addSignature(greeting, from);
  return decorateMessage(signed);
}

Try it: Compose your functions together!