The second version sets the property to the existing undefined value, and the first removes the key from the object. The difference can be seen when iterating over the object or using the in keyword.
var obj = {prop: 1}; 'prop' in obj; // true obj.prop = undefined; 'prop' in obj; // true, it there with the value of undefined delete obj.prop; 'prop' in obj; // false
source share