I read a javascript book (Flanegan), right now - about the delete operator.

The delete operator does not delete non-configurable properties whose configurable attribute is false. (However, it can delete custom properties of non-extensible objects.) Properties of embedded objects, as well as properties of a global object, created with instructions to declare variables and functions, are not customizable. Attempting to delete a non-configurable property in strict mode causes a TypeError exception. In non-strict mode (and in ECMAScript 3 implementations), in such cases the delete operator simply returns false

I spent a couple of tests in the console to make sure that everything works that way. The question arises: is there any case at all when delete with use strict returns false instead of throwing an exception?

    1 answer 1

    Well, if you look at the specification , namely paragraph 12.5.3.2 Runtime Semantics: Evaluation, we will see:

    There is no need for a syntax error, it can be a rule. In addition, if the operator has been selected, false, there is a TypeError exception is thrown.

    So, there should not be such. Is that, in some crooked browsers that could not properly implement the spec.