Javascript Core and HTML DOM Reference
JavaScript OOP:
http://phrogz.net/js/classes/OOPinJS.html
http://phrogz.net/js/classes/OOPinJS2.html
Primary types
number
string
boolean
Compound types
object
Special types
Functions are objects
Objects are passed by reference!
Reflection
typeof
typeof new Date()
//'object'
check undefined:
typeof( Obj ) === 'undefined'
check null:
!Obj
REMEMBER typeof( NullObj ) ==== 'object'. DON'T use typeof to check null, use ! or == null or null checking
Declaring variables
var keyword declares a variable
variable gets destroyed when the variable runs out of scope
global variables are declared outside of any function scope
If you assign values to variables that have not yet been declared, the variables will automatically be declared as global variables.
When working with DOM, global variables are attached to window object and be accessible to other files