Javascript Tutorial 08 Functions
Accessing a function without () will return the function definition instead of the function result:
Accessing a function without () will return the function definition instead of the function result:
Primitive types:
Complex types:
In JavaScript arrays are objects.
undefined
In JavaScript, a variable without a value, has the value undefined. The typeof is also undefined.
null
In JavaScript null is “nothing”. It is supposed to be something that doesn’t exist.
Unfortunately, in JavaScript, the data type of null is an object.
You can consider it a bug in JavaScript that typeof null is an object. It should be null.
Difference Between Undefined and Null
JavaScript evaluates expressions from left to right. Different sequences can produce different results:
JavaScript has dynamic types. This means that the same variable can be used to hold different data types:
Operator | Description |
---|---|
== | equal to |
=== | equal value and equal type |
!= | not equal |
!== | not equal value or not equal type |
typeof | Returns the type of a variable |
instanceof | Returns true if an object is an instance of an object type |