I’am novice in JS. While reading the book, I found that some examples do not work in firebug or maybe I simply don’t understand something.
For example:
>>> var a = 1;
undefined
>>> a
1
>>> this.a
1
>>> delete a
true
>>> a;
ReferenceError: a is not defined
Why I can delete property of a global object? I read that such variables are nonconfigurable and cannot be deleted.
Maybe that is not important, but it will be better if i understand what is going on:)
Answer by @JamesAllardice:
See this article for a comprehensive explanation of the delete operator, and an explanation of why you see this behaviour in Firebug: perfectionkills.com/understanding-delete