JavaScript quiz entry

in blurtutorials •  4 years ago 

image_search_1604234198321.png

Well, This is my JavaScript quiz entry post. If you want look out this announce post. Feel free to visit here.

Answers with reason :-

  1. After putting this code there will be a alert box saying hello with ok button. Even if we remove one window.alert there will be same result. The reason is calling "alert" call a pop-up box .

  2. Here there will be a alert popup box with nothing but ok click button. There will be nothing coz parentheses was empty.

  3. Here there will be again a alert box with undefined coz console.log made this undefined but after the click okay there will be a console saying @double-u has more than 2700000 BP.

  4. Here will be a console saying window.alert(x++) here alert function won't work coz console.log made it as just object. If we put double quotes on "x++" then there will be a alert but that time console will be undefined.

  5. Here will be error coz whatever written between parentheses that is not defined. We have to define 1st.

  6. This codes output will be x is now 20 and it will show 20 times because x is defined 20. If we would write console.log ("x is now" + i); then 20 times would different results from 0 to 19.

Thanks for the quiz so we could revise our minds.

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)

@charliechain you are right for most of the answers.

So here are some correction from my side :

  1. In part one the output will be a alert box saying hello and after that a undefined alert box will also appear as well.
    What you said is also correct.

  2. 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.

rest of your answers are correct.

Congratulations and keep practising.