Corrupted Scans
EasyAcc. 91.4%
+25 XP 8
Bio-Scan Mismatch
A medical droid scan is corrupted, returning NaN. Curiously, NaN is the only value in JavaScript not equal to itself.
- Attempt to parse
inputusingparseInt()and store it inval. - Check if
valis strictly equal to itself:val === val. - Return both the value and the check result in an array:
[val, isSame].
01EXAMPLE 1
Input
input = "Error"Output
[NaN, false]Explanation: NaN is not equal to NaN.
Constraints
- Observe that NaN === NaN returns false.
- Return an array [number, boolean].
FundamentalsTypesComparison
JavaScriptSystem handles I/O — write your function only
Loading...
8 Hidden
Input Arguments
input"Error"
Expected Output
[null,false]
Click RUN to test your solution