Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.01 KB

primitive-types.md

File metadata and controls

31 lines (21 loc) · 1.01 KB

🔓 Primitive Types

There are two types of data type in JavaScript, namely primitive type and reference type. We are going to cover primitive type over here only.

In the category of primitive types, aka value type, we have:

  • String
  • Number
  • Boolean
  • Undefined
  • Null

Here are the examples:

let name = "My Name";
let age = 18;
let choice = true;
let firstName = null;
let lastName = undefined;

let's check the type of the data using typeof in the console.





◀️ Previous Page : Basics of JavaScript : Constant 🔓                      🏡                    ▶️ Next Page : Basics of JavaScript : Arithmetic Operators 🔓