Skip to main content
D
JavaScript
JavaScript Data Types

JavaScript Data Types

JavaScript variables hold different types of data formats.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript categorizes data into different types so the computer knows how to handle it. You can do math with Number types, but you cannot do math with String types. JavaScript figures out the data type automatically based on the value.

Example

Example
1/* this shows different data types */
2let age = 25; // Number
3let name = "Alice"; // String
4let isReady = true; // Boolean

Key Points

  • String types hold text inside quotes.
  • Number types hold integers or decimals.
  • Boolean types hold true or false values.
  • Object types hold complex data structures.

Up Next

Continue your journey with the next topic.

Go to JS Functions