The Essence Scanner

Medium+20 XP

Mission Briefing

The vault will only open if a true element is placed on the pedestal. Some items look real but are merely illusions (falsy). Build a scanner to detect true essence.

The Concept: Truthy vs Falsy

In JS, every value has an inherent boolean state. A value is falsy if it translates to false when evaluated. The falsy values are: false, 0, -0, 0n, "", null, undefined, and NaN. Everything else is truthy.

The Objective

Your function receives a parameter val.

  1. Evaluate whether val is truthy or falsy.
  2. If it is truthy, return the exact string "Exists".
  3. If it is falsy, return the exact string "Empty".

Constraints

    FundamentalsLogic
    JavaScript
    Loading...
    3 Hidden

    Input Arguments

    val"Hi"

    Expected Output

    Exists

    Click RUN to test your solution