Loading...
QUIZ

Certification Test

 
Que No. 1 ) What does the isNaN() function in JavaScript do?

A.) Checks if a value is not a string
B.) Checks if a value is not a number
C.) Checks if a value is not an array
D.) Checks if a value is not an object


Que No. 2 ) Which loop is used for iterating over the properties of an object in JavaScript?

A.) for
B.) while
C.) do-while
D.) for...in


Que No. 3 ) What is the purpose of the break statement in JavaScript?

A.) To exit a loop or switch statement
B.) To continue to the next iteration of a loop
C.) To define a function
D.) To display an error message


Que No. 4 ) How do you create a new object in JavaScript?

A.) new Object()
B.) {} (Curly braces)
C.) Object.create()
D.) createObject()


Que No. 5 ) Which of the following is a falsy value in JavaScript?

A.) 0
B.) "false"
C.) null
D.) All of the above


Que No. 6 ) What does the splice() method do in JavaScript?

A.) Adds elements to the end of an array
B.) Removes elements from the beginning of an array
C.) Removes or replaces elements in an array
D.) Sorts the elements of an array


Que No. 7 ) Which event handler is used to execute a function when an element loses focus?

A.) onfocus
B.) onblur
C.) onmouseover
D.) onmouseout


Que No. 8 ) What does the querySelector() method do in JavaScript?

A.) Selects the first element that matches a specified CSS selector
B.) Selects all elements that match a specified CSS selector
C.) Adds a new element to the document
D.) Removes an element from the document


Que No. 9 ) Which method is used to add a class to an element in JavaScript?

A.) addClass()
B.) appendClass()
C.) classList.add()
D.) setClass()


Que No. 10 ) What is the purpose of the localStorage object in JavaScript?

A.) To store session data on the server
B.) To store data in a client's browser that persists across sessions
C.) To store data in cookies
D.) To store data in a database