Variables and Data Types In JavaScript, you store values in variables . There are three ways to declare a variable: Data Types Type Example Notes ----------- ------------------------ ------- String Text enclosed in quotes Number , Both integers and floats Boolean , Logical values Null Intentional absence of value Undefined Variable declared but not assigned Object Collection of key-value pairs Array Ordered list Example Summary Use by default, when the value will change, and avoid . JavaScript automatically figures out the type — you don't need to declare it explicitly.