Sobes.tech
Junior — Senior

Object property overwrite blocking

livecode

Task condition

It is necessary to ensure that the value of an object's property cannot be changed after it is set.

 const obj = {
    someProp: ''
}
console.log(obj.someProp)

obj.someProp = 'James'
console.log(obj.someProp)

The example shows the usual behavior of JavaScript, where the property someProp is overridden. It is required to modify the code so that an attempt to assign a new value does not change the original property value.