I can't delete variables in the console.
Why?
Declared variables are global pollutants. Once emitted they will be there forever!
This is why I always argued and was against the forced use of var declarations - and now we have two more. :)
Once you declare a variable that namespace becomes permanently reserved. undeclared globals, however can be deleted just like any other object property-name value pair which is a good thing.
In earlier days re-declaring the same variable name didn't use to throw a hard fault error - first came a soft notification that the variable name is already declared [if my memory serves me well], but later on, and because of complications that inability to delete an already declared var the re-declaration of the same required to rise an error on the attempt in order to make sure that the coder understands that the variable name has already been declared and present.
I think the answer to your question lies in this thread How to unset a JavaScript variable?
To summarise it you can delete a variable which is not declared using var
or let
as delete operator removes a property from an object but cannot remove a variable