Strictly Nullish

MediumAcc. 75.3%
+40 XP 12

The Nullish Perimeter

A common bug in JavaScript is treating 0 or "" as "missing data" because they are falsy. We need a logic that captures only null and undefined.

The Assignment

Your function receives a parameter named val.

  1. Return true if the value is strictly null or strictly undefined.
  2. Return false for any other value, including other falsy values like 0, false, or "".

01EXAMPLE 1

Inputval = 0
Outputfalse

Explanation: 0 is falsy, but not nullish.

Constraints

  • Return a boolean.
  • Do not be fooled by other falsy values.
LogicTypesMastery
JavaScript
Loading...
3 Hidden

Input Arguments

val0

Expected Output

false

Click RUN to test your solution