Explorer
Node.js

Write a function `createGreeting(name, time)` that returns `"Good {time}, {name}!"` using template literals.

Problem Statement

Write a function `createGreeting(name, time)` that returns `"Good {time}, {name}!"` using template literals.

Complexity

Time Complexity: -

Space Complexity: -

Hints

šŸ’” Hint 1: Template literals use backticks (`) instead of quotes. šŸ’” Hint 2: Embed expressions with ${expression} inside template literals. šŸ’” Hint 3: return `Good ${time}, ${name}!`; āœ… Solution: ```javascript function createGreeting(name, time) { return `Good ${time}, ${name}!`; } ```

Template Literals

Easy
Write a function `createGreeting(name, time)` that returns `"Good {time}, {name}!"` using template literals.
Editor
Loading Editor...
Evaluate code
Output:Click "Run" above to execute and verify your code here.
["Good morning, Alice!","Good evening, Bob!"]