Objects

Property Updates

Property Updates

A const object variable keeps pointing at the same object, but the object's properties can still change. Updating a property changes the object, not the binding.

That distinction appears constantly in real code: a task becomes complete, a user changes roles, or a request changes status.

Your task: Update task.done so the task is complete. Then create taskStatus from the updated property and log it. Do not replace task with a new object.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Property Updates

A const object variable keeps pointing at the same object, but the object's properties can still change. Updating a property changes the object, not the binding.

That distinction appears constantly in real code: a task becomes complete, a user changes roles, or a request changes status.

Your task: Update task.done so the task is complete. Then create taskStatus from the updated property and log it. Do not replace task with a new object.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Console

Run code to see output.