Skip to content

eslint/no-delete-var Correctness ​

✅ This rule is turned on by default.

What it does ​

The purpose of the delete operator is to remove a property from an object.

Why is this bad? ​

Using the delete operator on a variable might lead to unexpected behavior.

Example ​

Examples of incorrect code for this rule:

javascript
var x;
delete x;

References ​

Released under the MIT License.