You need to sign in to do that
Don't have an account?

Unable to delete JS object property
Hey,
I'm trying to delete property on one of my objects, but I"m seein this error:
Cannot delete property 'Field Name' of #<Object>
I've already verified the field is on the object, so I know the error isn't due to it missing or anything. But guessing because of the new secure objects we arn't able to call a delete on the object to remove the property?
Here's an example of what I'm trying to do:
I'm trying to delete property on one of my objects, but I"m seein this error:
Cannot delete property 'Field Name' of #<Object>
I've already verified the field is on the object, so I know the error isn't due to it missing or anything. But guessing because of the new secure objects we arn't able to call a delete on the object to remove the property?
Here's an example of what I'm trying to do:
if(object[fieldx]){ console.log(object); delete object[fieldx]; }
Instead of deleting the property from the object. Assign the value of the property as 'Undefined' and check if it fits in your business requirement.
let know if this helps you in finding your Answer then mark it as Best Answer.