JavaScript Trivia Quiz

19 Questions | Attempts: 147
Share

SettingsSettingsSettings
JavaScript Trivia Quiz - Quiz

.


Questions and Answers
  • 1. 

    Inside which HTML element do we put the JavaScript?

    • A.

      1

    • B.

      2

    • C.

      3

    • D.

      4

    Correct Answer
    B. 2
  • 2. 

    Which of the following JavaScript statements use arrays?

    • A.

      SetTimeout("a["+i+"]",1000)

    • B.

      K = a & i

    • C.

      K = a(i)

    Correct Answer
    A. SetTimeout("a["+i+"]",1000)
  • 3. 

    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

    Correct Answer
    A. Window.location.href
  • 4. 

    Wich best describe void?

    • A.

      A method

    • B.

      A function

    • C.

      An operator

    • D.

      A statement

    Correct Answer
    C. An operator
  • 5. 

    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")

    Correct Answer
    B. Document.write("Hello World")
  • 6. 

    How do you call a function named "myFunction"?

    • A.

      Call myFunction()

    • B.

      MyFunction()

    • C.

      Call function myFunction

    Correct Answer
    B. MyFunction()
  • 7. 

    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

    Correct Answer
    C. If (i==5)
  • 8. 

    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

    Correct Answer
    A. Two. The "for" loop and the "while" loop
  • 9. 

    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

    Correct Answer
    B. If (i != 5)
  • 10. 

    How does a "for" loop start?

    • A.

      For (i = 0; i

    • B.

      For (i = 0; i

    • C.

      For i = 1 to 5

    • D.

      For (i

    Correct Answer
    B. For (i = 0; i
  • 11. 

    What is the correct way to write a JavaScript array?

    • A.

      Var txt = new Array("tim","shaq","kobe")

    • B.

      Var txt = new Array="tim","shaq","kobe"

    • C.

      Var txt = new Array(1:"tim",2:"shaq",3:"kobe")

    Correct Answer
    A. Var txt = new Array("tim","shaq","kobe")
  • 12. 

    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

    Correct Answer
    C. Onmousedown and onmouseup
  • 13. 

    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;

    Correct Answer
    A. Var myarray = new Array();
  • 14. 

    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)

    Correct Answer
    B. Math.round(8.25)
  • 15. 

    CHow 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)

    Correct Answer
    A. Math.max(6,8)
  • 16. 

    How do you find the client's browser name?

    • A.

      Navigator.appName

    • B.

      Client.navName

    • C.

      Browser.name

    Correct Answer
    A. Navigator.appName
  • 17. 

    What is the correct JavaScript syntax for opening a new window called "window5" ?

    • A.

      New("http://www.ex-designz.net","window5")

    • B.

      Window.open("http://www.ex-designz.net","window5")

    • C.

      Open.newwindow("http://www.ex-designz.net","window5")

    • D.

      New.window("http://www.ex-designz.net","window5")

    Correct Answer
    B. Window.open("http://www.ex-designz.net","window5")
  • 18. 

    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")

    Correct Answer
    A. Window.status = "put your message here"
  • 19. 

    Why we use Javascript ? Describe Advantages of Javascript ..

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 24, 2018
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 21, 2015
    Quiz Created by
    Haxor Cefee
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.