Back

Functions & Scope / Simple Greeting

00:00
1/20

Simple Greeting

Easy

Write a function greet(name) that returns "Hello, name!". If no name is provided, default to "Guest".

  • 1

    Use default parameters for the 'name'.

  • 2

    Return a template literal string.

JAVASCRIPT PLAYGROUND
JAVASCRIPT PLAYGROUND
⏳ Loading editor…