JavaScript Trivia Quiz

19 Questions | Attempts: 147
Share
SettingsSettings
Please wait...
  • 1/19 Questions

    You define an array using

    • Var myarray = new Array();
    • Var myarray = array new;
    • Var new Array() = myarray;
    • Var new array = myarray;
Please wait...
JavaScript Trivia Quiz - Quiz
About This Quiz

.


Quiz Preview

  • 2. 

    What is the correct JavaScript syntax to write "Hello World"?

    • Response.write("Hello World")

    • Document.write("Hello World")

    • ("Hello World")

    • Echo("Hello World")

    Correct Answer
    A. Document.write("Hello World")
  • 3. 

    CHow do you find the largest number of 6 and 8?

    • Math.max(6,8)

    • Top(6,8)

    • Ceil(6,8)

    • Math.ceil(6,8)

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

    How do you write a conditional statement for executing some statements only if "i" is NOT equal to 5?

    • If (i 5)

    • If (i != 5)

    • If =! 5 then

    • If 5

    Correct Answer
    A. If (i != 5)
  • 5. 

    How does a "for" loop start?

    • For (i = 0; i

    • For (i = 0; i

    • For i = 1 to 5

    • For (i

    Correct Answer
    A. For (i = 0; i
  • 6. 

    How do you call a function named "myFunction"?

    • Call myFunction()

    • MyFunction()

    • Call function myFunction

    Correct Answer
    A. MyFunction()
  • 7. 

    How do you write a conditional statement for executing some statements only if "i" is equal to 5?

    • If i==5 then

    • If i=5 then

    • If (i==5)

    • If i=5

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

    How do you round the number 8.25, to the nearest whole number?

    • Math.rnd(8.25)

    • Math.round(8.25)

    • Round(8.25)

    • Rnd(8.25)

    Correct Answer
    A. Math.round(8.25)
  • 9. 

    What is the correct way to write a JavaScript array?

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

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

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

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

    Inside which HTML element do we put the JavaScript?

    • 1

    • 2

    • 3

    • 4

    Correct Answer
    A. 2
  • 11. 

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

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

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

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

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

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

    Which of the following JavaScript statements use arrays?

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

    • K = a & i

    • K = a(i)

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

    Which property would you use to redirect visitor to another page?

    • Window.location.href

    • Document.href

    • Java.redirect.url

    • Link.redirect.href

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

    How many different kind of loops are there in JavaScript?

    • Two. The "for" loop and the "while" loop

    • Four. The "for" loop, the "while" loop, the "do...while" loop, and the "loop...until" loop

    • One. The "for" loop

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

    How do you find the client's browser name?

    • Navigator.appName

    • Client.navName

    • Browser.name

    Correct Answer
    A. Navigator.appName
  • 16. 

    Onclick is equivalent to which two events in sequence

    • Onmouseover and onmousedown

    • Onmousedown and onmouseout

    • Onmousedown and onmouseup

    • Onmouseup and onmouseout

    Correct Answer
    A. Onmousedown and onmouseup
  • 17. 

    Wich best describe void?

    • A method

    • A function

    • An operator

    • A statement

    Correct Answer
    A. An operator
  • 18. 

    How do you put a message in the browser's status bar?

    • Window.status = "put your message here"

    • Statusbar = "put your message here"

    • Status("put your message here")

    • 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 (Updated): Jul 24, 2018 +

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.