JavaScript Arrays and Objects Quiz

Test your knowledge of arrays and objects in JavaScript.

Question 1

What method adds an element to the end of an array?

Question 2

How do you access the property of an object?

Question 3

What will fruits.length return for the array `fruits=['apple', 'banana']`?

Question 4

Which method removes the last element from an array?

Question 5

What does `push()` do in JavaScript?

Question 6

How do you delete a property from an object?

Question 7

Which of the following is an array of objects?

Question 8

What method would you use to check if an array includes a certain value?

Question 9

How can you iterate over an array in JavaScript?

Question 10

What is the correct way to create an object in JavaScript?