Empty States

EasyAcc. 96.4%
+15 XP 5

Nothing vs Missing

In web development, empty data has two main concepts. undefined happens completely naturally when a value is totally missing or not declared yet. null is deliberately assigned to indicate "empty on purpose."

The Assignment

Your function gets a signal property from a server.

  1. If the input signal is "u", return undefined.
  2. If the input signal is "n", return null.
  3. For any other signal, just return false.

01EXAMPLE 1

Inputsignal = "n"
Outputnull

Explanation: Intentional null value.

Constraints

  • Return literal null or undefined.
  • Do not use text strings like "null".
FundamentalsTypes
JavaScript
Loading...
5 Hidden

Input Arguments

signal"u"

Expected Output

Click RUN to test your solution