Skip to content

Conversation

@simonsayscode
Copy link

From the MDN article on delete (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete):

delete is only effective on an object's properties. It has no effect on variable or function names.

While sometimes mis-characterized as global variables, assignments that don't specify an object (e.g. x = 5) are actually property assignments on the global object.

Updating the answers to properly reflect this.

From the MDN article on delete (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete):
------------
delete is only effective on an object's properties. It has no effect on variable or function names.
While sometimes mis-characterized as global variables, assignments that don't specify an object (e.g. x = 5) are actually property assignments on the global object.
------------

Updating the answers to properly reflect this.
Repository owner deleted a comment from SanaKanwal3 Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant