After reading JavaScript Garden, I took notes as below but is it possible prove number 2. Please validate & correct my other proofs also.
- undefined is a type.
- undefined type has only one value. that values is undefined.
- There is a global variable called undefined
- global undefined variable has default value undefined
- global undefined variable is not a constant
- undefined is not a keyword
Proof (tested in firebug console)
1. typeof undefined \\undefined
2. Need proof
3. var name = undefined; \\ global
variable undefined is assigned to
name
4. alert(name); \\ undefined, that
means undefined global variable has
value undefined
5. undefined = 'rajakvk'; \\ we can
change value
6. var undefined = 'rajakvk'; \\ no
syntax error
var if = 'rajakvk'; \\ SyntaxError: missing variable name