Sobes.tech
Intern

What data types do you know?

sobes.tech AI

Answer from AI

Primitive types:

  • String: Text strings.
  • Number: Numbers (integers and floating-point).
  • Boolean: Logical values (true or false).
  • Null: Absence of a value, intentionally set by the developer.
  • Undefined: Absence of a value that has not yet been assigned.
  • Symbol: A unique and immutable primitive, often used as object keys.
  • BigInt: Arbitrary-precision integers.

Object type:

  • Object: A complex data type used for storing collections of data and more complex entities.

    // Example of an object
    const person = {
        name: 'Alexander',
        age: 30
    };
    

Additionally, functions in JavaScript are also first-class objects:

// Example of a function
const greet = function(name) {
    return `Hello, ${name}!`;
};
What data types do you know? — Node.js - sobes.tech