Closed raulsebastianmihaila closed 5 years ago
I believe delete returns false when the property is not deleted, for example when it’s nonconfigurable.
As for semantics, what does deleting a nonexistent property do in strict mode?
There was an error in the README, the result of delete null?.foo
is the same as delete (0,undefined)
. Thanks for noticing.
@ljharb The delete
operator returns true if the (own) property is not present.
As the title says, I'd be surprised if the
delete
operator would ever produce a non-Boolean. Since deleting non-existing references in sloppy mode producestrue
I thinktrue
should be produced bydelete a?.x
whena
isnull
orundefined
.