184k views
1 vote
What value is returned by the following expression? !isNaN(12.345)

a) NaN

b) true

c) false

d) undefined

User Ericcco
by
7.4k points

1 Answer

7 votes

Final answer:

The value returned by the expression is true.

Step-by-step explanation:

The value returned by the expression !isNaN(12.345) is true.

The !isNaN() function is used to check whether a value is not a number (NaN) or a number.

In this case, since 12.345 is a valid number, the expression !isNaN(12.345) returns true.

User Tresbot
by
8.0k points