Changing non-enumerable property value will return error in strict mode. In non-strict mode it won't through any error but it won't change the value of phoneNo.
Value of phoneNo won't change because 'writable' descriptor is false by default, not because 'enumerable' is false.
If you had:
Object.defineProperty(person, 'phoneNo',{
value : '8888888888',
enumerable: false,
writable: true,
})
Hi, thanks for the questionnaire!
A small correction:
Value of phoneNo won't change because 'writable' descriptor is false by default, not because 'enumerable' is false.
If you had:
you would be able to change property value.