Flat Preloader Icon

JS Data Types

JavaScript, being a dynamically typed language, supports several data types.

  1. Primitive Data Types:

    • Number: Represents numeric values, both integers and floating-point numbers.
    • String: Represents sequences of characters, enclosed in single or double quotes.
    • Boolean: Represents a logical value, either true or false.
    • Undefined: Represents a variable that has been declared but not assigned a value.
    • Null: Represents the intentional absence of any object value.
    • Symbol: Introduced in ECMAScript 6 (ES6), represents a unique identifier.
  2. Non-primitive Data Type:

    • Object: Represents a collection of key-value pairs, where values can be of any data type (including other objects), and accessed by keys.
  3. Special Data Types:

    • Function: In JavaScript, functions are first-class citizens and can be assigned to variables, passed as arguments, and returned from other functions.

Share on: