Equality Comparisons
EasyAcc. 91.7%
+25 XP 10
Data Integrity
Verification systems must decide when two pieces of data are truly equal. Loose Equality (==) allows for type conversion, while Strict Equality (===) checks both value and type.
- Perform a loose comparison between
val1andval2. - Perform a strict comparison between
val1andval2. - Return both results in an array:
[looseResult, strictResult].
01EXAMPLE 1
Input
val1 = "42", val2 = 42Output
[true, false]Explanation: Coercion allows loose equality to pass.
Constraints
- Return an array [boolean, boolean].
- Prefer strict equality for all real-world code.
FundamentalsComparisonEquality
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
val1"42"
val242
Expected Output
[true,false]
Click RUN to test your solution