Which values will be returned?

HOTSPOT
You are validating user input by using built-in JavaScript functions.
The application must:
Store the value that is entered in a variable named inputValue
Use the built-in isNaN(tnputValue) function to evaluate the data typeYou need to validate the return value of the isNaN(inputValue) function.
Which values will be returned? (To answer, configure the appropriate options in the dialog box in the answer
area.)
Hot Area:

HOTSPOT
You are validating user input by using built-in JavaScript functions.
The application must:
Store the value that is entered in a variable named inputValue
Use the built-in isNaN(tnputValue) function to evaluate the data typeYou need to validate the return value of the isNaN(inputValue) function.
Which values will be returned? (To answer, configure the appropriate options in the dialog box in the answer
area.)
Hot Area:

Answer:

Explanation:
isNan is false for all these inputs.
The isNaN() function determines whether a value is an illegal number (Not-a-Number).
This function returns true if the value is NaN, and false if not.
JavaScript parseInt() Function; JavaScript isNaN() Function



Leave a Reply 4

Your email address will not be published. Required fields are marked *

2 × 4 =


D

D

False
False
True
True
if the user put in the input 3*8
then
$(‘#myUserInput’).value == ‘3*8’ and isNaN(‘3*8’) = true

the same for ‘5’ -> isNaN(“‘5′”) = true

But it’s not totally clear, I agree. I guessed that because the input should be the same, in all the case you should have a string like ‘23.4’ and ‘-13’, so I didn’t understand why it was ‘5’, so that’s a trap…

Adolf

Adolf

The answer is correct.