Introduction to Javascript
Data Types
Javascript has 6 primitive data types
number
string
boolean
undefined
null
Symbol
Objects
Objects
can store a collection of data types, which are then calledproperties
.- Each property has a
key
andvalue
key
is ofstring
data typesvalue
can be ofany data type
.
- If a
value
is a functon, its called as amethod
Equality in Objects
==
or ===
only tests if both operands are same objects.
Arrays
Objects
that store values in order.
Functions
Use function
keyword to define a function.
- You may provide a name, if not, its called an
anonymous
function. - Primatives data types passed in the function are passed by value but Objects are passed by reference.
Functions( Both named or anonymous) can be assigned to a variable.
Source: