This week, we will choose some of these function ideas to implement together. These exercises will help you practice writing functions, working with parameters, and returning values.
makeGreeting(name, occasion) → "Happy Birthday, Alex!"addSignature(message, from) → "Happy Birthday, Alex! — from Sam"decorateMessage(message) → "🌸🌸 Happy Birthday, Alex! 🌸🌸"convertToCups(ml) → returns equivalent in cupscalculateTip(total, percent) → returns total × (1 + tip)applyDiscount(price, discount) → returns price × (1 − discount)double(x) → returns x × 2addTax(price, rate) → returns price × (1 + rate)distance(p1, p2) → returns distance using Math.sqrt((x2−x1)² + (y2−y1)²)mixColors(c1, c2) → returns average colorlighten(color, percent) → returns lighter hex or RGB valueconvertArrayToRGB(r, g, b) → 'rgb(r, g, b)'toSnakeCase(text) → 'helloWorld' → 'hello_world'toKebabCase(text) → 'helloWorld' → 'hello-world'toCamelCase(text) → 'hello_world' → 'helloWorld'simplifyPokemonObject(pokemonObject) → returns { name, type, height, weight }tempToday(weatherObject) → returns today’s temperatureconditionsToday(weatherObject) → returns current conditions (like "Sunny", "Rainy")