Lancecourse
Courses
How-tos
Blog
Sign In
Sign Up
free
Francais
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?
push()
get()
add()
append()
Question 2
How do you access the property of an object?
object.property
object[]
object.get()
object.property[]
Question 3
What will fruits.length return for the array `fruits=['apple', 'banana']`?
2
3
undefined
NaN
Question 4
Which method removes the last element from an array?
pop()
shift()
remove()
delete()
Question 5
What does `push()` do in JavaScript?
Adds an element to the end of an array
Removes the first element of an array
Creates a new array
Clears an array
Question 6
How do you delete a property from an object?
delete object.property
remove property
object.remove(property)
clear(object.property)
Question 7
Which of the following is an array of objects?
const users = [{name: "Alice"}, {name: "Bob"}]
const users = "Alice, Bob"
const users = ["Alice", "Bob"]
const users = new Object()
Question 8
What method would you use to check if an array includes a certain value?
includes()
indexOf()
find()
contains()
Question 9
How can you iterate over an array in JavaScript?
forEach()
map()
reduce()
filter()
Question 10
What is the correct way to create an object in JavaScript?
const obj = {}
const obj = new Object()
const obj = []
const obj = Object.create()
Answer all the questions then submit.
Submit Answers