Why 'delete' will not work with local variables in javascript ? -
here code
(function(x){ delete x; return x; })(1);
even after deleted variable x , still work , return value 1.
is delete work object property , global variables?
the delete
operator only used deletion of properties on object. cannot leveraged delete variable-- nor there use cases in javascript such thing necessary. can set variable null
or undefined
substitute.
Comments
Post a Comment