Well, This is my JavaScript quiz entry post. If you want look out this announce post. Feel free to visit here.
Answers with reason :-
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 .
Here there will be a alert popup box with nothing but ok click button. There will be nothing coz parentheses was empty.
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.
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.
Here will be error coz whatever written between parentheses that is not defined. We have to define 1st.
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.
@charliechain you are right for most of the answers.
So here are some correction from my side :
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.
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.