Type Validation

EasyAcc. 97.4%
+20 XP 5

Boolean Guard

As an application architect, you must ensure inputs are of the correct type. The typeof operator identifies the primitive type of any value.

  1. Use typeof to determine the type of inputVal.
  2. Return true if it is exactly "boolean", otherwise return false.

01EXAMPLE 1

InputinputVal = true
Outputtrue

Explanation: Correct type identified.

Constraints

  • Use typeof.
  • Return a boolean.
FundamentalsComparisonTypes
JavaScript
Loading...
9 Hidden

Input Arguments

inputValtrue

Expected Output

true

Click RUN to test your solution