NEW
Font size
WorksheetsJavaScript Certification Quiz
Total questions: 25
Worksheet time: 13mins
Which keyword is used for debugging in JavaScript?
warn
error
debugger
log
What is the purpose of the 'typeof' operator in JavaScript?
To concatenate two strings
To check if a variable is defined
To determine the data type of a variable or constant
To convert a string to a number
Which operator is used for exponentiation in JavaScript?
^
**
*
/
What will be the output of the following code snippet?
6.28
6
3.14
NaN
Which method is used to add a new element to the end of an array in JavaScript?
append
insert
push
add
What is the purpose of the 'Math.random()' function in JavaScript?
To generate a random number between 0 and 1
To find the square root of a number
To calculate the absolute value of a number
To round a number to the nearest integer
Which event is triggered when a user clicks on an HTML element?
onhover
onmove
onclick
onpress
What does the 'onsubmit' event represent in HTML forms?
Event when the form is focused
Event when the form is submitted
Event when the form is reset
Event when the form is loaded
How can you handle exceptions in JavaScript?
catch/throw
try/except
try/catch
throw/finally
Which method is used to locate an HTML element by its ID in JavaScript?
getElementByName
getElementById
getElementByClass
getElementByTag
What is the purpose of the 'eval()' function in JavaScript?
To find the square root of a number
To evaluate a mathematical expression
To convert a string to a number
To round a number to the nearest integer
Which operator is used to check if two values are equal in JavaScript?
===
!=
==
!==
What is the correct way to declare a variable in JavaScript according ECMASCRIPT6?
let x
int x
var x
variable x
Which method is used to create a new HTML element in JavaScript?
addNode
appendElement
createElement
createNode
What is the purpose of the 'onchange' event in HTML forms?
Event when the form value is changed
Event when the form is submitted
Event when the form is reset
Event when the form is loaded
What will be the output of the following code snippet?
true
false
undefined
NaN
What will be the output of the following code snippet?
mango
2
mango
3
apple
2
apple
3
What will be the output of the following code snippet?
1
2
3
undefined
What will be the output of the following code snippet?
10
15
5
20
What will be the output of the following code snippet?
null
object
undefined
number
What will be the output of the following code snippet?
[1, 2, 4, 5]
[1, 2, 3, 5]
[1, 2, 3, 4, 5]
[1, 2, 4, 5, 6]
What will be the output of the following code snippet?
undefined
null
Hello
test
What will be the output of the following code snippet?
array
object
undefined
null
What will be the output of the following code snippet?
5.67
5.68
5.6789
5.679
What will be the output of the following code snippet?
123
NaN
123abc
undefined
