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.
- If the input
signalis "u", returnundefined. - If the input
signalis "n", returnnull. - For any other signal, just return
false.
01EXAMPLE 1
Input
signal = "n"Output
nullExplanation: Intentional null value.
Constraints
- Return literal null or undefined.
- Do not use text strings like "null".
FundamentalsTypes
JavaScriptSystem handles I/O — write your function only
Loading...
5 Hidden
Input Arguments
signal"u"
Expected Output
Click RUN to test your solution