1. Question: Which of following JavaScript version is introduced strict equality(===) and strict inequality(!==) operators ?

    A
    JavaScript 1.1

    B
    JavaScript 1.2

    C
    JavaScript 1.3

    D
    JavaScript 1.4

    Note: If you had an application where both the value and the type of data are important to compare, you could not make that comparison with standard comparison operators.To fix this problem JavaScript introduced this operator
    1. Report
  2. Question: what is the output of bellow code?
    var posVal= 44;
    var negVal= -posVal;
    var diffVal= (posVal-negVal);
    document.write(diffVal);

    A
    44

    B
    88

    C
    -44

    D
    0

    Note: Not available
    1. Report
  3. 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
  4. Question: What will be the output of the following code:
    <script>
     var alpha="Apples";
     var beta=alpha+"Oranges";
     var gamma=Math.sqrt(omega);
     var delta=200/gamma;
     alert(delta);
    </script>

    A
    No output because ReferenceError: omega is not defined

    B
    200

    C
    null

    D
    delta

    Note: Not available
    1. Report
  5. Question: Which is the following is not reserved word in JavaScript?

    A
    synchronized

    B
    implements

    C
    const

    D
    integer

    Note: Not available
    1. Report
  6. Question: What will be output of the following JavaScript code:
    <script>
    var apples=2.0;
    var oranges=2.34;
    var pears=3.3;
    var tax=.04;
    var shipping=3.43;
    var subtotal=apples+oranges+pears;
    var total=subtotal+(subtotal*tax)+shipping;
    var message="Your total is $";
    var deliver=message+total+".";
    document.write(deliver);
    </script>

    A
    Your total is $11.37

    B
    No output

    C
    Your total is $11.3

    D
    deliver

    Note: Not available
    1. Report
  7. Question: What will be output for the following javascript code:
    <script>
    var alpha=0xdead;
    var beta=0xbeef;
    var gamma=(alpha+beta).toString(10);
    document.write(gamma);
    </script>

    A
    105884

    B
    Syntax error

    C
    0xdead0xbeef

    D
    gamma

    Note: Not available
    1. Report
  8. Question: What will be output for the following JavaScript:
    <script>
    var a=5
    var b=4
    var c=(a>b)
    var d="Your stock is worth "+(c*20)+" thousand dollars.";
    alert(d);
    </script>

    A
    Your stock is worth 20 thousand dollars.

    B
    Your stock is worth 0 thousand dollars.

    C
    No output

    D
    Syntax error

    Note: Not available
    1. Report
  9. Question: What will be output for the following javascript code fragment:
    var wrong=(6==5)
    document.write(wrong);

    A
    false

    B
    true

    C
    wrong

    D
    syntax error

    Note: Not available
    1. Report
  10. Question: What will produce output for the following javascript code fragment:
    <script>
    var alpha=20
    var beta=25
    var zeta=(alpha<=beta);
    if(zeta){
    	var sigma="This is true";
    }else{
    	var sigma="This is not true";
    }
    document.write(sigma);
    </script>

    A
    This is true

    B
    This is not true

    C
    Syntax error

    D
    sigma

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