Search⌘ K
AI Features

Numbers, Strings & Booleans

Explore the basics of JavaScript variables focusing on numbers, strings, and booleans. Understand how to create and manage these types correctly, including how to escape characters in strings and the importance of descriptive variable names for readable code.

We'll cover the following...

Types of Variables

There are a few different types of variables in JavaScript. We’ll discuss numbers, strings, and booleans first.

Numbers

Numbers are just what you’d expect and what we’ve been using in the examples above. 19, 30, 924311933 are all numbers. We can’t use commas, spaces, or other characters when we create numbers. We have to use continuous digits.

Strings

Strings are different. We can think of them as the way we represent text in ...