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.
- Use
typeofto determine the type ofinputVal. - Return
trueif it is exactly "boolean", otherwise returnfalse.
01EXAMPLE 1
Input
inputVal = trueOutput
trueExplanation: Correct type identified.
Constraints
- Use typeof.
- Return a boolean.
FundamentalsComparisonTypes
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
inputValtrue
Expected Output
true
Click RUN to test your solution