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 a shallow copy of an object?
What is the difference between shallow and deep cloning?
What is the result of the following code?
What does the Object.assign() method do?
How do you merge two objects together using the spread operator?
Which method would you use for deep cloning an object?
What happens if two objects have the same property when merging?
What is the result of the following code?
How do you prevent modifications to an object after it has been created?
What is the difference between Object.freeze() and Object.seal()?
How do you create a shallow copy of an object?
What is the difference between shallow and deep cloning?
What is the result of the following code?
const obj1 = { a: 1 }; const obj2 = { b: 2 }; const merged = { ...obj1, ...obj2 }; console.log(merged);
What does the Object.assign() method do?
How do you merge two objects together using the spread operator?
Which method would you use for deep cloning an object?
What happens if two objects have the same property when merging?
What is the result of the following code?
const obj1 = { a: 1, b: 2 }; const obj2 = { b: 3, c: 4 }; const merged = Object.assign({}, obj1, obj2); console.log(merged);