Wednesday, July 01, 2015
 IT Quizzes Category

Search Web Link
Search Software
Quizzes Main Page    IT Quizzes    JavaScript 2 Quiz

JavaScript 2 Quiz

There are 18 questions in this quiz. Good luck!
Passing grade is 70% = C.
1) Inside which HTML element do we put the JavaScript?
       a) <scripting>
       b) <javascript>
       c) <script>
       d) <js>

2) What is the correct JavaScript syntax to write "Hello World"?
       a) response.write("Hello World")
       b) document.write("Hello World")
       c) ("Hello World")
       d) echo("Hello World")

3) How do you call a function named "myFunction"?
       a) call function myFunction
       b) myFunction()
       c) call myFunction()

4) How do you write a conditional statement for executing some statements only if "i" is equal to 5?
       a) if i==5 then
       b) if i=5 then
       c) if (i==5)
       d) if i=5

5) How do you write a conditional statement for executing some statements only if "i" is NOT equal to 5?
       a) if (i <> 5)
       b) if (i != 5)
       c) if =! 5 then
       d) if <> 5

6) How many different kind of loops are there in JavaScript?
       a) Two. The "for" loop and the "while" loop
       b) Four. The "for" loop, the "while" loop, the "do...while" loop, and the "loop...until" loop
       c) One. The "for" loop

7) How does a "for" loop start?
       a) for (i = 0; i <= 5)
       b) for (i = 0; i <= 5; i++)
       c) for i = 1 to 5
       d) for (i <= 5; i++)

8) What is the correct way to write a JavaScript array?
       a) var txt = new Array(1:"tim",2:"shaq",3:"kobe")
       b) var txt = new Array="tim","shaq","kobe"
       c) var txt = new Array("tim","shaq","kobe")

9) How do you round the number 8.25, to the nearest whole number?
       a) Math.rnd(8.25)
       b) Math.round(8.25)
       c) round(8.25)
       d) rnd(8.25)

10) How do you find the largest number of 6 and 8?
       a) Math.max(6,8)
       b) top(6,8)
       c) ceil(6,8)
       d) Math.ceil(6,8)

11) What is the correct JavaScript syntax for opening a new window called "window5" ?
       a) new("","window5")
       c) open.newwindow("","window5")
       d) new.window("","window5")

12) How do you put a message in the browser's status bar?
       a) window.status = "put your message here"
       b) statusbar = "put your message here"
       c) status("put your message here")
       d) window.status("put your message here")

13) How do you find the client's browser name?
       b) navigator.appName
       c) client.navName

14) You define an array using
       a) var myarray = new Array();
       b) var myarray = array new;
       c) var new Array() = myarray;
       d) var new array = myarray;

15) Onclick is equivalent to which two events in sequence
       a) onmouseover and onmousedown
       b) onmousedown and onmouseout
       c) onmousedown and onmouseup
       d) onmouseup and onmouseout

16) Whicj best describe void?
       a) A method
       b) A function
       c) An operator
       d) A statement

17) Which property would you use to redirect visitor to another page?
       a) window.location.href
       b) document.href
       c) java.redirect.url
       d) link.redirect.href

18) Which of the following JavaScript statements use arrays?
       a) setTimeout("a["+i+"]",1000)
       b) k = a & i
       c) k = a(i)

Copyright © 2000 - 2013 Ex-designz. All rights reserved. Website Developed By Dexter Zafra of
Link to us | Advertisement | Contact us | Privacy Policy | Terms of use | Accessibility