Loading...
QUIZ

Certification Test

 
Que No. 1 ) Which method is used to find the index of the first occurrence of a value in an array?

A.) indexOf()
B.) findIndex()
C.) search()
D.) find()


Que No. 2 ) What does the map() method do in JavaScript?

A.) Adds new elements to an array
B.) Removes elements from an array
C.) Creates a new array with the results of calling a function on each element of the original array
D.) Sorts an array in place


Que No. 3 ) Which of the following is not a valid way to declare an object in JavaScript?

A.) {name: "John", age: 30}
B.) new Object("name", "John", "age", 30)
C.) Object.create({name: "John", age: 30})
D.) Object({name: "John", age: 30})


Que No. 4 ) What is the purpose of the Promise object in JavaScript?

A.) To handle asynchronous operations and callbacks
B.) To create a new object
C.) To perform arithmetic operations
D.) To manipulate strings


Que No. 5 ) How do you define a class in JavaScript?

A.) classMyClass {}
B.) functionMyClass() {}
C.) varMyClass = class() {}
D.) class = MyClass() {}


Que No. 6 ) What is the purpose of the fetch() function in JavaScript?

A.) To fetch data from a database
B.) To fetch data from an external API
C.) To fetch data from a local file
D.) To fetch data from a web server


Que No. 7 ) Which of the following methods can be used to remove an element from the beginning of an array in JavaScript?

A.) pop()
B.) shift()
C.) splice()
D.) slice()


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

A.) Adds all the elements of an array together
B.) Removes all the elements of an array
C.) Creates a new array with the results of calling a function on each element of the original array
D.) Sorts an array in place


Que No. 9 ) How do you check if a variable is null or undefined in JavaScript?

A.) isUndefined(variable)
B.) variable == null
C.) variable === null
D.) Both B and C


Que No. 10 ) What is the purpose of the bind() method in JavaScript?

A.) To concatenate two strings
B.) To set the value of a variable
C.) To bind a function to a specific context or object
D.) To create a new object