FrontendInterviews.dev

643. Frozen Object with Nested State

Easy•

Predict the output.

const user = Object.freeze({ profile: { age: 20 } })
user.profile.age = 21
console.log(user.profile.age)

What is printed in the console?

Select an option and submit your answer.
Next Problem