1. Question: Which of the following functions in JavaScript can be used to check whether the input data from a prompt window is number or not

    A
    toString()

    B
    Math.floor()

    C
    perseInt()

    D
    perseFloat()

    Note: perseFloat() will consider all numbers including integers but perseInt() will only consider integer.
    1. Report
  2. Question: What is the output of the following in JavaScript?
    var input="12.51km";
    length=parseFloat(input);
    document.write(length);

    A
    12.51km

    B
    12km

    C
    12.51

    D
    12

    Note: Not available
    1. Report
  3. Question: The 'function' keyword is optional in JavaScript.

    A
    True

    B
    False

    Note: Not available
    1. Report
  4. Question: Which of the following is the highest level of objects in the context of JavaScript?

    A
    Window

    B
    Form

    C
    Array

    D
    File

    Note: Not available
    1. Report
  5. Question: What will be output of the following javascript code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <title>Untitled Document</title>
    <script>
    var tax=.02
    function addTax(item){
      var total=item+(item+tax);
      var newTotal=Math.floor(total);
      var fraction=Math.round(total*100)%100;
      if(fraction<10){
    	fraction="0"+fraction
      }
      
      total=newTotal+"."+fraction
      alert("Your total is $"+total);
      	
    }
    
    </script>
    </head>
    <body>
    <script>
     addTax(1.5);
    </script>
    </body>
    </html>

    A
    Your total is $3.02

    B
    Compile error

    C
    Your total is $1.5

    D
    Your total is $total

    Note: Not available
    1. Report
  6. Question: Which of the following javascript method is used to check if a expression is infinite or not?

    A
    checkInfinite()

    B
    isFinite()

    C
    isInfinite()

    D
    checkFinite()

    Note: Not available
    1. Report
  7. Question: Which of the following javascript method is used to check if a expression or a variable is NaN or not?

    A
    isNaN()

    B
    NaN()

    C
    checkNaN()

    D
    notNaN()

    Note: Not available
    1. Report
  8. Question: What will produce output for the following JavaScript code fragment:
    <script>
    var leftOperand=77;
    var rightOperand=30;
    var divEm=leftOperand/rightOperand;
    var nada=0/0;
    
    if(!isFinite(divEm)){
     document.write("Whoa Dude that's a big number!");
    }
    
    if(isNaN(nada)){
     document.write("You are dividing nothing by nothing");
    }
    </script>

    A
    You are dividing nothing by nothing

    B
    Whoa Dude that's a big number!

    C
    No output

    D
    syntax error

    Note: Not available
    1. Report
  9. Question: What will produce for the following JavaScript code fragment?
    var BidA="33";
    var BidB="24"
    document.write(Math.max(BidA,BidB));

    A
    33

    B
    24

    C
    error

    D
    undefined

    Note: Math.max() method automatically convert string arguments into numbers first and then return largest one
    1. Report
  10. Question: Which of the following method is used to evaluate a string of Java Script code in the context of the specified object?

    A
    Eval

    B
    ParseDoule

    C
    ParseObject

    D
    Efloat

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd