In JavaScript,
NaN
stands for Not a Number.
If we perform an arithmetic operation
on a value that is not a number,
we get NaN
as the result.
In the example given above,
the value stored
in the personID
variable
is a string.
So when we perform
personID * 2
we are multiplying a string
with a number.
Hence the result is NaN
.
Here's another example
where performing an arithmetic operation
on a value that is not a number,
results in NaN
.