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
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
Inside which element do you put JavaScript?
<var>
<script>
<section>
<code>
Next >
2/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 >
3/25
Which is the correct way to write a comment in JavaScript?
{# ... #}
<!--- .... ---!>
// ....
\\ ...
Next >
4/25
Which array method sorts the elements of an array?
sort()
changeOrder(order)
order()
None of the above metjods
Next >
5/25
How do you open a new window with JavaScript?
window.open(...);
window.new(...);
open(new window());
window.open_new(...);
Next >
6/25
How do you open a confirm window in JavaScript?
confirm()
location.confirm()
window.open_confirm()
window.new_confirm()
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 create a new function in JavaScript?
new.function() {}
function myFunction() {}
function:myFunction() {}
function = myFunction() {}
Next >
9/25
Can you set any style to HTML tag using JavaScript?
yes
no
Next >
10/25
What is called the functions with no return value?
Static function
Method
Procedures
Dynamic function
Next >
11/25
What is a closure?
Scope where the variables of functions are resolved
Function objects
It is both scope where the variables of functions are resolved and function objects
None of the above options
Next >
12/25
Which are closures?
Variables
Objects
Functions
All of the above options
Next >
13/25
Which of the following options is the opposite of the lexical scoping?
Literal scoping
Dynamic scoping
Generic scoping
Static scoping
Next >
14/25
Which of the following options is right for dynamic scoping?
Variables can be declared outside the scope
Variables cannot be declared outside the scope
Variables must be declared outside the scope
None of the mentioned
Next >
15/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 >
16/25
Which method is used to serialize an object into a JSON string in JavaScript?
JSON.stringify()
JSON.parse()
Object.toString()
Stringify.object()
Next >
17/25
What is the output of 'Boolean(0)' in JavaScript?
true
false
null
undefined
Next >
18/25
What does 'Event Bubbling' mean in JavaScript?
An error in event handling
When an event is directly handled by the element that it occurs on
When an event propagates from the innermost to the outermost element
The process of triggering multiple events in a sequence
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
What will 'console.log(1 + '2' + '3')' output in JavaScript?
'6'
'123'
'15'
An error
Next >
21/25
How can you prevent a default action in an event handler in JavaScript?
event.preventDefault()
event.stop()
preventDefault()
event.stopPropagation()
Next >
22/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 >
23/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 >
24/25
How can you convert the string '3.14' to a number in JavaScript?
Number('3.14')
parseNum('3.14')
int('3.14')
parseFloat('3.14')
Next >
25/25
Which JavaScript property is used to write a message to the console?
document.write()
console.log()
window.print()
alert()
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.