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
EN
DE
RU
FR
ES
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
How do you write "Hello W3docs" in an alert box?
alertBox("Hello W3docs");
alert("Hello W3docs");
msg("Hello W3docs");
msgBox("Hello W3docs");
modal("Hello W3docs")
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
How do you round the number 5.35 to the nearest integer?
rnd(5.35)
Math.rnd(5.35)
round(5.35)
Math.round(5.35)
Next >
4/25
How do you open a new window with JavaScript?
window.open(...);
window.new(...);
open(new window());
window.open_new(...);
Next >
5/25
How do you write anything into the web page in JavaScript?
window.write(...)
document.write(...)
window.page.write(...)
document.page.write(...)
Next >
6/25
Which of the following events occurs when the user clicks on an HTML element?
onchange
onmouseover
onmouseclick
onclick
onmouseup
Next >
7/25
How do you create a new function in JavaScript?
new.function() {}
function myFunction() {}
function:myFunction() {}
function = myFunction() {}
Next >
8/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 >
9/25
Which of the following is used for assigning a value to a variable?
*
=
-
x
Next >
10/25
What will happen if the return statement doesn’t have the associated expression?
It will throw an exception
It will return 0
It will return undefined
None of the above options
Next >
11/25
What does 'this' refer to in a JavaScript method?
The global object
The function itself
The object that called the method
The document object
Next >
12/25
How do you access the first element of an array named 'myArray'?
myArray[0]
myArray[1]
myArray.first
first(myArray)
Next >
13/25
What is the use of the 'async' keyword in JavaScript?
To pause the execution of a function
To declare a function as asynchronous
To speed up code execution
To synchronize two functions
Next >
14/25
Which event occurs when a user clicks on an HTML element in JavaScript?
onmouseover
onclick
onchange
onhover
Next >
15/25
Which operator is used to compare both the value and the type?
==
===
!=
!==
Next >
16/25
What is the result of 'typeof NaN' in JavaScript?
'number'
'NaN'
'undefined'
'null'
Next >
17/25
What is the default scope of a variable declared with 'var' in JavaScript?
Local scope
Block scope
Global scope
Function scope
Next >
18/25
Which method in an array adds new elements to the end of an array?
push()
pop()
shift()
unshift()
Next >
19/25
Which JavaScript method is used to remove the last element from an array and return that element?
pop()
push()
last()
removeLast()
Next >
20/25
Which method is used to add one or more elements to the beginning of an array?
unshift()
shift()
push()
prepend()
Next >
21/25
What is the correct syntax for creating a new Date object in JavaScript?
var myDate = new Date();
var myDate = Date.now();
var myDate = createNewDate();
var myDate = new DateObject();
Next >
22/25
How do you find the number with the highest value of two numbers in JavaScript?
Math.max(x, y)
Math.highest(x, y)
top(x, y)
Math.maximum(x, y)
Next >
23/25
Which of these is not a valid JavaScript data type?
Undefined
Number
Float
Boolean
Next >
24/25
What method is used to transform a string into an integer in JavaScript?
int.parse()
Number.parseInt()
parseInt()
Math.parseInt()
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.