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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -