Data Types, Operators & Primitives

In notebook:
FrontEndMasters Advanced JS fundamentals
Created at:
2015-10-07
Updated:
2015-10-07
Tags:
Fundamentals JavaScript
Learn JS Fundamentals to jQuery & Pure DOM Scripting

Basic Data Types

Primitive Data Types
Undefined      ​undefined​  (a variable that has not been set yet)
Null                ​null​ (the null pointer - usually set by intent in the code)
Boolean         ​true
String            ​"hello"
Number        ​2​ (​and also NaN​)

Object Data Types
Object          ​{name:"value"}
Array            ​[1,2,3]
Date             ​new Date()
RegExp        ​/.*/g
Function      ​function(){}


Operators

​var ​                  ​var foo
new                 new Foo
assignment
delete              ​delete foo.bar​ there's no real deleting, it just deletes the reference
member          ​foo.bar
call                  ​bar()
comparison     ​==​ ​===