# JavaScript Data Types

#### js_datatypes.html

### About JavaScript

JavaScript is the most widely used programming language on the web and is easy to learn.
In this chapter, we will cover the most important functions of JavaScript, but not go into depth. If you want to know more, take a look at the references.

### Data Types

There are 6 primitive datatypes:

- number
- string
- boolean
- undefined
- null
- symbol

### Variables: const and let

There are 3 keywords for declaring variables in JS:

- const: signals that the variable won’t be reassigned
- let: signals that the variable might be reassigned
- var: don’t use it

Rule of thumb: Always use const over let unless it is really not possible (for example, let is useful as a loop index).

### Objects

Objects are used to store key-value pairs. They can have properties and methods.

### More about JS

- JS Tutorial on www.w3schools.com
- JS Tutorial from Mozilla
- Eloquent JavaScript (book on modern JS programming)
- Codepen (playground for experimenting with JS/HTML/CSS)
- Enki (JS workouts on your phone)