Back to course

Introduction to JavaScript Data Types (Primitives Overview)

JavaScript: The Complete '0 to Hero' Beginner Course

11. Introduction to Data Types

Data types define the kind of value a variable can hold. JavaScript is a dynamically typed language, meaning you don't declare the type explicitly (like int or string); the type is determined automatically when the code runs.

Primitive Data Types

Primitives are immutable (cannot be changed) values. There are seven in JS:

  1. Number: Used for both integers and floating-point numbers.
  2. String: Used for text, enclosed in quotes.
  3. Boolean: Logical entity; either true or false.
  4. null: Represents the intentional absence of any object value.
  5. undefined: Means a variable has been declared but has not yet been assigned a value.
  6. Symbol: A unique identifier (advanced, covered later).
  7. BigInt: For arbitrarily large integers.

Non-Primitive (Reference) Data Type

  1. Object: Used for complex data structures (including Arrays and Functions).