How ready are you with JavaScript, find out!!

Function showMeWhatYouGot( ){}; 1 min


  1. 1 Inside which HTML element do we put the JavaScript?

    1. ⋖scripting>
    2. ⋖javascript>
    3. ⋖js>
    4. ⋖script>
    Correct!
    Wrong!
  2. 2 What is the correct JavaScript syntax to change the content of the HTML element below? ⋖p id="demo">This is a demonstration.⋖/p>

    1. document.getElementById("demo").innerHTML = "Hello World!";
    2. document.getElementByName("p").innerHTML = "Hello World!";
    3. #demo.innerHTML = "Hello World!";
    4. document.getElement("p").innerHTML = "Hello World!";
    Correct!
    Wrong!
  3. 3 Where is the correct place to insert a JavaScript?

    1. Both the ⋖head> section and the ⋖body> section are correct
    2. The ⋖body> section
    3. The ⋖head> section
    Correct!
    Wrong!
  4. 4 What is the correct syntax for referring to an external script called "xxx.js"?

    Advertisements
    1. ⋖script name="xxx.js">
    2. ⋖script src="xxx.js">
    3. ⋖script href="xxx.js">
    Correct!
    Wrong!
  5. 5 The external JavaScript file must contain the ⋖script> tag.

    1. True
    2. False
    Correct!
    Wrong!
  6. 6 How do you write "Hello World" in an alert box?

    1. alertBox("Hello World");
    2. msg("Hello World");
    3. alert("Hello World");
    4. msgBox("Hello World");
    Correct!
    Wrong!
  7. 7 How do you create a function in JavaScript?

    1. function = myFunction()
    2. function:myFunction()
    3. function myFunction()
    Correct!
    Wrong!
  8. 8 How do you call a function named "myFunction"?

    Advertisements
    1. call function myFunction()
    2. myFunction()
    3. call myFunction()
    Correct!
    Wrong!
  9. 9 How to write an IF statement in JavaScript?

    1. if i = 5 then
    2. if i == 5 then
    3. if (i == 5)
    4. if i = 5
    Correct!
    Wrong!
  10. 10 How to write an IF statement for executing some code if "i" is NOT equal to 5?

    1. if (i != 5)
    2. if (i 5)
    3. if i =! 5 then
    4. if i 5
    Correct!
    Wrong!
  11. 11 How does a WHILE loop start?

    1. while (i <= 10)
    2. while (i <= 10; i++)
    3. while i = 1 to 10
    Correct!
    Wrong!
  12. 12 How does a FOR loop start?

    Advertisements
    1. for (i = 0; i <= 5)
    2. for (i <= 5; i++)
    3. for i = 1 to 5
    4. for (i = 0; i <= 5; i++)
    Correct!
    Wrong!
  13. 13 What is the correct way to write a JavaScript array?

    1. var colors = ["red", "green", "blue"]
    2. var colors = (1:"red", 2:"green", 3:"blue")
    3. var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue")
    4. var colors = "red", "green", "blue"
    Correct!
    Wrong!
  14. 14 How do you round the number 7.25, to the nearest integer?

    1. Math.floor(7.25)
    2. Math.round(7.25)
    3. Math.rnd(7.25)
    4. Round(7.25)
    Correct!
    Wrong!
  15. 15 How do you find the number with the highest value of x and y?

    1. ceil(x, y)
    2. top(x, y)
    3. Math.max(x, y)
    4. Math.ceil(x, y)
    Correct!
    Wrong!
  16. 16 What is the correct JavaScript syntax for opening a new window called "w2" ?

    Advertisements
    1. w2 = window.new("http://www.w3schools.com");
    2. w2 = window.open("http://www.w3schools.com");
    Correct!
    Wrong!
  17. 17 How can you detect the client's browser name?

    1. client.navName
    2. browser.name
    3. navigator.appName
    Correct!
    Wrong!
  18. 18 Which event occurs when the user clicks on an HTML element?

    1. onclick
    2. onmouseclick
    3. onmouseover
    4. onchange
    Correct!
    Wrong!
  19. 19 How do you declare a javascript variable

    1. let name = "Mary"
    2. name == 'Mary'
    3. variable name = "Mary"
    Correct!
    Wrong!
  20. 20 Is JavaScript case-sensitive?

    1. No
    2. Yes
    Correct!
    Wrong!

How ready are you with JavaScript, find out!!

Created on
  1. Quiz result
    You scored
    Correct!
    Share Your Result
  2. Quiz result

    OUCH

    You scored
    Correct!

    JavaScript needs strong soldiers. You need to practice more to be fit. Check out some resources on our website

    Share Your Result
  3. Quiz result

    A Bird Told Me....

    You scored
    Correct!

    You scored more than average but why eat half when you could eat the whole bowl. Good score but you need to practice more...

    Share Your Result
  4. Quiz result

    DING!

    You scored
    Correct!

    Great score. JavsScript is becoming more natural to you. Keep it up

    Share Your Result
  5. Quiz result

    EXCELLENT SCORE

    You scored
    Correct!

    Only a few people can manage an overall score in this quiz and you! my programmer is that few people. Congratulations

    Share Your Result
Advertisements

Like it? Share with your friends!

Nnaji Victor

Legend

DecaDev, Full-stack developer in training, Gamer, Techie and weirdly cool. I love writing new stuffs that I just discovered and playing around on the net. Check my socials or email me.

What's Your Reaction?

Wow Wow
2
Wow
love love
1
love
hate hate
0
hate
geeky geeky
0
geeky
win win
1
win

0 Comments

Choose A Format
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Poll
Voting to make decisions or determine opinions
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Countdown
The Classic Internet Countdowns
Open List
Submit your own item and vote up for the best submission
Ranked List
Upvote or downvote to decide the best list item

Send this to a friend