Books
Learn HTML
Learn CSS
Learn Git
Learn Javascript
Learn PHP
Learn python
Learn Java
Exercises
HTML
JavaScript
Git
CSS
PHP
Courses
Quizzes
Snippets
Tools
General Tools
Password Generator
HTML Editor
HTML Encoder
Base 64
Code Diff
JSON Beautifier
CSS Beautifier
Markdown Convertor
Find the Closest Tailwind CSS Color
Phrase encrypt / decrypt
Browser Feature Detection
Number convertor
JTW Decoder
CSS Maker
CSS Maker
CSS Maker text shadow
CSS Maker Text Rotation
CSS Maker Out Line
CSS Maker RGB Shadow
CSS Maker Transform
CSS Maker Font Face
Color Tools
Color Picker
Colors CMYK
Colors HWB
Colors HSL
Color Hex
Color mixer
Color Converter
Colors RGB
Color Contrast Analyzer
Color Gradient
String Tools
String Length Calculator
MD5 Hash Generator
Sha256 Hash Generator
String Reverse
URL Encoder
URL Decoder
Base 64 Encoder
Base 64 Decoder
Extra Spaces Remover
String to Lowercase
String to Uppercase
Word Count Calculator
Empty Lines Remover
HTML Tags Remover
Binary to Hex
Hex to Binary
Rot13 Transform on a String
String to Binary
Duplicate Lines Remover
Change theme
Dark
Light
System
Books
Learn HTML
Learn CSS
Learn Git
Learn Javascript
Learn PHP
Learn python
Learn Java
How To
How To NodeJs
How To Linux
How To AngularJs
How To PHP
How To HTML
How To CSS
How To Symfony
How To Git
How To Apache
How To JavaScript
How To Java
How To Vue.js
How To Python
Javascript Basics
1/25
Which is the correct way to write a comment in JavaScript?
{# ... #}
<!--- .... ---!>
// ....
\\ ...
Next >
2/25
Which of the following is the correct syntax to redirect a URL using JavaScript?
document.location='http://www.w3docs.com';
navigator.location='http://www.w3docs.com';
window.location='http://www.w3docs.com';
browser.location='http://www.w3docs.com';
Next >
3/25
Which array method sorts the elements of an array?
sort()
changeOrder(order)
order()
None of the above metjods
Next >
4/25
Which function is used to load the next URL in the history list?
window.history.next();
window.history.load_next();
window.history.forward();
window.history.load_forward();
Next >
5/25
How do you open a confirm window in JavaScript?
confirm()
location.confirm()
window.open_confirm()
window.new_confirm()
Next >
6/25
How do you get cookies in JavaScript?
window.cookies
location.cookies
document.cookie
document.cookies
Next >
7/25
How do you write anything into the web page in JavaScript?
window.write(...)
document.write(...)
window.page.write(...)
document.page.write(...)
Next >
8/25
How do you get the DOM element with id in JavaScript?
window.getElementById(...)
document.getElementById(...)
page.getElementById(...)
document.innerHTML.getElementById(...)
Next >
9/25
The JavaScript Date is fundamentally specified as ___
The number of milliseconds elapsed since January 1, 1970
The number of picoseconds elapsed since January 1, 1970
The number of minutes elapsed since January 1, 1980
The number of days that have elapsed since January 1, 1980
Next >
10/25
Which of the following is the correct way to write “Welcome to W3docs” on the web page?
document.write(“Welcome to W3docs”);
system.out.println(“Welcome to W3docs”);
print(“Welcome to W3docs”);
response.write(“Welcome to W3docs”);
Next >
11/25
Which of the following does the pop() method do?
It increments the total length by 1
It decrements the total length by 1
It prints the first element but no effect on the length
None of the above options
Next >
12/25
Which of the following is used to identify the array?
===
typeof
isarrayType()
==
Next >
13/25
Which of the following is used for assigning a value to a variable?
*
=
-
x
Next >
14/25
What is the purpose of the 'const' keyword in JavaScript?
To declare a variable that might change later
To declare a constant variable whose value cannot be changed
To create a new function
To define a conditional statement
To import a module
Next >
15/25
Which event occurs when a user clicks on an HTML element in JavaScript?
onmouseover
onclick
onchange
onhover
Next >
16/25
What method is used to round a number to the nearest integer in JavaScript?
Math.round()
Math.floor()
Math.ceil()
Number.round()
Next >
17/25
What will be the output of 'console.log(typeof undefined)'?
'undefined'
'null'
'object'
'number'
Next >
18/25
Which JavaScript method is used to iterate over all properties of an object?
Object.forEach()
for...in
Object.loop()
forEach()
Next >
19/25
How do you declare a class named 'Car' in JavaScript?
class Car {}
function Car() {}
new Class(Car)
createClass('Car')
Next >
20/25
What is the event loop in JavaScript?
A loop that handles event listeners
The mechanism that allows JavaScript to perform non-blocking operations
A type of for loop
A method to loop through event properties
Next >
21/25
Which method in an array adds new elements to the end of an array?
push()
pop()
shift()
unshift()
Next >
22/25
What is the use of 'break' in JavaScript?
To stop the execution of a loop
To break the code into multiple lines
To exit a function
To pause the debugger
Next >
23/25
How can you prevent a default action in an event handler in JavaScript?
event.preventDefault()
event.stop()
preventDefault()
event.stopPropagation()
Next >
24/25
Which of the following is a correct method to create a new array?
var myArray = new Array();
var myArray = [];
var myArray = newArray();
var myArray = Array[];
Next >
25/25
Which JavaScript method is used to sort the elements of an array?
array.sort()
sort(array)
array.order()
order(array)
Next >
To get the result of the quiz, please provide your email address (optional)..
Get Certificate
It seems you haven't answered any questions yet. Please provide your answers to proceed.