ProTechSolution
Home
Courses
Exercises
Quiz
Roadmaps
Experts
Login
Sign Up
Bootstrap 5 UI
Programming Concepts
HTML & CSS Masterclass
HTML
CSS
JavaScript
PHP
MySQL
Bootstrap 5
C#
JavaScript Certification Quiz
Test your knowledge to earn your official course certificate!
1. The external JavaScript file must contain the <script> tag.
True
False
Only in old browsers
Sometimes
2. JavaScript is the same as Java.
True
False
Mostly True
Only in Netscape
3. Which event occurs when the user clicks on an HTML element?
onmouseclick
onchange
onclick
onmouseover
4. How do you round the number 7.25, to the nearest integer?
Math.rnd(7.25)
Math.round(7.25)
round(7.25)
rnd(7.25)
5. How to write an IF statement for executing some code if 'i' is NOT equal to 5?
if (i != 5)
if i =! 5 then
if (i <> 5)
if i <> 5
6. How does a WHILE loop start?
while (i <= 10; i++)
while i = 1 to 10
while (i <= 10)
while (i++)
7. How can you detect the client's browser name?
navigator.appName
browser.name
client.navName
window.browser
8. What will the following code return: Boolean(10 > 9)
true
false
NaN
undefined
9. Is JavaScript case-sensitive?
No
Yes
Only for variables
Only for functions
10. How do you create a function in JavaScript?
function myFunction()
function:myFunction()
function = myFunction()
create myFunction()
11. How do you call a function named 'myFunction'?
call function myFunction()
myFunction()
call myFunction()
execute myFunction()
12. Inside which HTML element do we put the JavaScript?
<javascript>
<scripting>
<js>
<script>
13. How to insert a comment that has more than one line?
<!--This is a comment-->
/*This is a comment*/
//This is a comment//
'This is a comment'
14. Where is the correct place to insert a JavaScript?
The <body> section
The <head> section
Both the <head> section and the <body> section are correct
Outside the <html> tag
15. What is the correct JavaScript syntax for opening a new window called 'w2'?
w2 = window.open('http://www.w3schools.com');
w2 = window.new('http://www.w3schools.com');
w2 = open('http://www.w3schools.com');
w2 = new('http://www.w3schools.com');
16. How does a FOR loop start?
for (i <= 5; i++)
for (i = 0; i <= 5)
for (i = 0; i <= 5; i++)
for i = 1 to 5
17. Which operator is used to assign a value to a variable?
-
*
x
=
18. What is the correct syntax for referring to an external script called 'xxx.js'?
<script href='xxx.js'>
<script name='xxx.js'>
<script src='xxx.js'>
<script file='xxx.js'>
19. How do you declare a JavaScript variable?
v carName;
variable carName;
var carName;
declare carName;
20. How do you find the number with the highest value of x and y?
top(x, y)
Math.max(x, y)
Math.ceil(x, y)
ceil(x, y)
Submit Quiz (20 Questions)