PrepAway - Latest Free Exam Questions & Answers

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 type
You 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.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

16 Comments on “Which values will be returned?

    1. Alaeddin says:

      isNaN(“3*8”) = true
      isNaN(“‘5′”) = true

      there are false
      test like this dont change them to string coz all string true;
      isNaN(3*8) = true
      isNaN(‘5′) = true




      0



      0
  1. Sergiu says:

    Try this:

    TestIsNaN

    var testIsNaN = function() {
    alert(document.getElementById(‘test’).value + ‘ is not a number: ‘ + isNaN(document.getElementById(‘test’).value));
    }

    So the provided answers are correct:
    -13: false
    24.3: false
    3*8: true
    ‘5’: true




    1



    0

Leave a Reply