JavaScript Quiz
Test your knowledge in
JavaScript
!
1. How to write an IF statement in JavaScript?
a. if (i == 5)
b. if i = 5 then
c. if i == 5 then
d. if i = 5
2. How does a WHILE loop start?
a. while (i <= 10)
b. while i = 1 to 10
c. while (i <= 10; i++)
3. How do you round the number 7.25, to the nearest integer?
a. Math.round(7.25)
b. round(7.25)
c. rnd(7.25)
d. Math.rnd(7.25)
4. What is the correct JavaScript syntax for opening a new window called "w2" ?
a. w2 = window.new("http://www.w3schools.com");
b. w2 = window.open("http://www.w3schools.com");
5. How can you detect the client's browser name?
a. navigator.appName
b. client.navName
c. browser.name