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.

  1. Attempt to parse input using parseInt() and store it in val.
  2. Check if val is strictly equal to itself: val === val.
  3. Return both the value and the check result in an array: [val, isSame].

01EXAMPLE 1

Inputinput = "Error"
Output[NaN, false]

Explanation: NaN is not equal to NaN.

Constraints

  • Observe that NaN === NaN returns false.
  • Return an array [number, boolean].
FundamentalsTypesComparison
JavaScript
Loading...
8 Hidden

Input Arguments

input"Error"

Expected Output

[null,false]

Click RUN to test your solution