Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptgetters and settersSingle-choice MCQ

In strict mode, what happens when you assign to a property that has only a getter defined?

'use strict'; const obj = { get x() { return 42; } }; obj.x = 99; console.log(obj.x);