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.

  1. Use a standard function declaration.
  2. Return a greeting string formatted exactly as: "Welcome aboard, [name]!"
  3. Example: if name is "Captain", return "Welcome aboard, Captain!"

01EXAMPLE 1

Inputname = "Captain"
Output"Welcome aboard, Captain!"

Constraints

  • Return the greeting as a string.
FundamentalsFunctions
JavaScript
Loading...
3 Hidden

Input Arguments

name"Captain"

Expected Output

Welcome aboard, Captain!

Click RUN to test your solution