Javascript - Primitive Types
Code Life
By Pierre Marsaa
What are Primitive Types?
Now that you know how to create variables, it's time to discover the different types of data you can store in them!
In JavaScript, the most basic types of data are called primitive types. They are the simplest forms of information you can work with, but they're also the foundation of everything else.
There are three main primitive types you'll use all the time:
- String → Text and words (like your Codémon's name)
- Number → Numbers for math and counting (like your Codémon's level)
- Boolean → True or false values (like whether your Codémon is ready for battle)
↗️
Loading editor...
↶
↷
Notice how each type looks different? Strings need quotes, numbers don't, and booleans use the special words true or false. Let's explore each type in detail!
Verify