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
What does the spread operator do in JavaScript?
Which of the following correctly uses the spread operator?
What is the output of the following code: const arr = [1, 2]; const newArr = [...arr, 3]; console.log(newArr);?
How do you use the rest parameter in function definitions?
Which statement about rest parameters is true?
What is the output of this function call: function sum(...numbers) { return numbers.reduce((a, b) => a + b); } sum(1, 2, 3);?
Can spread and rest operators be used with objects?
Which of the following correctly spreads the properties of an object?
Can the spread operator be used to copy arrays and objects?
What is the result of this code: const [a, ...rest] = [10, 20, 30, 40]; console.log(rest);?