Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

Which method creates a new array by applying a function to each element of an array?

View

What is the result of the following code?

View

Which array method is used to filter out elements that do not pass a specific test?

View

What is the output of the following code?

View

Which method can be used to iterate over an array without returning a new array?

View

What is the return value of reduce() when applied to an array?

View

What does the following code return?

View

Which method is used to find the index of the first element that satisfies a condition in an array?

View

What is the output of the following code?

View

Which method is used to determine if at least one element in an array passes a test?

View

Which method creates a new array by applying a function to each element of an array?

filter()
map()
forEach()
reduce()

What is the result of the following code?

var arr = [1, 2, 3, 4]; var newArr = arr.map(x => x * 2); console.log(newArr);

[1, 2, 3, 4]
[2, 4, 6, 8]
[1, 4, 9, 16]
[0, 2, 4, 6]

Which array method is used to filter out elements that do not pass a specific test?

map()
reduce()
filter()
splice()

What is the output of the following code?

var arr = [1, 2, 3, 4, 5]; var result = arr.filter(x => x > 3); console.log(result);

[1, 2, 3]
[4,5]
[1, 2]
[3, 4, 5]

Which method can be used to iterate over an array without returning a new array?

map()
forEach()
filter()
concat()

What is the return value of reduce() when applied to an array?

A single value
A new array
A boolean value
The last element of the array

What does the following code return?

var arr = [1, 2, 3, 4]; var sum = arr.reduce((total, num) => total + num, 0); console.log(sum);

10
7
4
6

Which method is used to find the index of the first element that satisfies a condition in an array?

findIndex()
find()
indexOf()
some()

What is the output of the following code?

var arr = [10, 20, 30]; var result = arr.find(x => x > 15); console.log(result);

20
10
30
undefined

Which method is used to determine if at least one element in an array passes a test?

every()
some()
filter()
map()