The JavaScript Programming Language
Variable Types and Values
Variable types
Primitive types: number, string, boolean, null, undefined
Object types: object, array, function
A function is an object that has executable code associated with it. Special kind of funcions are constructors.
Predefined classes: Array, Function, Date, RegExp, Error
You can define your own classes of objects by defining appropriate constructor functions.
garbage collection = JS interpreter perform destruction or deallocation of created objects automatically, so programmer has no worry about that
Each object can have methods, even primitive types like Strings, Numbers. Only null and undefined can't have methods.
Javascript converts values (types) automatically. If variable is number and program expects string it will convert it automatically.
Variables have scope. Variables outside functions have global scope and can be accesed inside functions. On the other side variables inside functions are local variables and are accessible only inside that function.