My Entry for JAVASCRIPT quiz #1

in javascriptquiz •  4 years ago 

Here is my attempt to question No 1 ( 1-6)

Answers:

  1. window.alert(window.alert("hello"));
    Ans: Here we will see a hello alert box.

  2. window.alert( );
    Ans: Here no message will be seen in alert box as their is no message written inside the brackets "( )".

  3. window.alert(console.log("@double-u has more than 2700000 BP"));
    Ans: Here alert box will show a message as @double-u has more than 2700000 BP.

  4. var x = 1;
    console.log("window.alert( x++ )");
    Ans : Here after pressing F12 we can see message as window.alert(x++).

  5. console.log(@afrog is attending the quiz);
    Ans : I don't know this as there is no double quotation mark so i don't know what will be the output. If "@afrog is attending the quiz" was written like this then after F12 we can see the full sentence as message there.

  6. {

          var x = 20 ;
           for(i=0; i<x ; i++)
           { 
             console.log("x is now " + x ); 
           }
    

}
Ans : here till the time 'i' is less than 'x' we will see x is now 20 in console.

Thank You

SEE THE QUIZ HERE

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!
Sort Order:  
  ·  4 years ago  ·   (edited)

@kahkashanrkploy here is my words for your attemp.

  1. In first part we wont just see a hello message in the alert box but we will also see another alert box with undefined message just after we press ok for the hello alert box as there are two alert functions one with parameter and another without parameter.
    And first the inner alert function is executed and then outer.

  2. In part 3 we wont see the message in alert box but in the console. also we will see a alert box with undefined message.

  3. In part 5 we have written a complete string without the double quotation mark. that simply violates the syntax plus we have not even defined those seperately in the code so thats why web page will be loaded but in console we will see error.
    You you are atleast right about the that we will see error.

  1. You are correct for the last part as well , theirfore we will be seeing the "x is now 20" printed twenty
    times.

Thanks again for participation and keep practising.

Thanks for your participation. Kindly wait for the upvotes.
Thank You.

ok i ll wait , are my answers correct?