The Greeting Protocol
Easy+20 XP
Mission Briefing
The orbital station requires a new automated greeter for incoming starships. You must define a reusable welcoming protocol.
The Concept: Function Declarations
A function is like a specialized machine. You give it some materials (parameters), it does some work, and it gives back a finished product (the return value). Using the function keyword declares a block of reusable code.
The Objective
Your function receives a string name.
- Use a standard function declaration.
- Return a greeting string formatted exactly as: "Welcome aboard, [name]!"
- Example: if
nameis "Captain", return "Welcome aboard, Captain!"
01EXAMPLE 1
Input
name = "Captain"Output
"Welcome aboard, Captain!"Constraints
- Return the greeting as a string.
FundamentalsFunctions
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
name"Captain"
Expected Output
Welcome aboard, Captain!
Click RUN to test your solution