Java Reference
In-Depth Information
Data Types
JavaScript has six different types of value. There are five primitive
data types
:
• string
• number
• Boolean
• undefined
• null
Any value that isn't one of the primitive data types listed is an
object
(these are covered in
JavaScript has a special
operator
called
typeof
for finding out the type of a value.
Here are some examples of the different value types:
typeof "hello"
<< "string"
typeof 10
<< "number"
typeof true
<< "boolean"
typeof { ninja: "turtle" }
<< "object"
Note: Operators
An operator applies an operation to a value, which is known as the
operand
.
A
unary operator
only requires one operand; for example: