How can I unset a JavaScript variable?
The delete operator removes a property from an object. It cannot remove a variable. So the answer to the question depends on how the global variable or property is defined. (1) If it is created with var, it cannot be deleted. For example: (2) If it is created without var, it can be deleted. Technical Explanation 1. Using var In … Read more