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

How do you create an empty array in JavaScript?

View

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

View

What does the pop() method do in JavaScript arrays?

View

What is the result of the following code?

View

How do you remove the first element from an array?

View

Which method joins all elements of an array into a string?

View

What does the splice() method do?

View

What is the output of the following code?

View

Which method can be used to reverse the elements of an array?

View

What does the concat() method do in arrays?

View

How do you create an empty array in JavaScript?

var arr = {}
var arr = []
var arr = new Object()
var arr = ()

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

arr.push()
arr.add()
arr.append()
arr.insert()

What does the pop() method do in JavaScript arrays?

Removes the first element of the array.
Adds a new element to the start of the array.
Removes the last element of the array.
Sorts the array elements.

What is the result of the following code?

var arr = [1, 2, 3]; arr.pop(); console.log(arr);

[1, 2]
[1, 2, 3]
[3]
[]

How do you remove the first element from an array?

arr.shift()
arr.pop()
arr.removeFirst()
arr.delete(0)

Which method joins all elements of an array into a string?

arr.join()
arr.concat()
arr.toString()
arr.joinToString()

What does the splice() method do?

Removes elements from an array
Adds elements to an array
Both a and b
None of the above

What is the output of the following code?

var arr = [1, 2, 3]; arr.splice(1, 1); console.log(arr);

[1, 3]
[1, 2, 3]
[2, 3]
[]

Which method can be used to reverse the elements of an array?

arr.flip()
arr.reverse()
arr.swap()
arr.invert()

What does the concat() method do in arrays?

Combines two or more arrays
Joins all elements into a string
Removes duplicates from an array
Sorts the array