Interactive online courses HTML Academy
2026-03-09 14:06 Diff

On the previous step, you learned about three data types:

  • number for numbers,
  • string for strings,
  • boolean for logical or boolean values, true or false.

In reality, you learned about four data types. Special data type undefined contains just one value undefined.

By the way, the number type in JavaScript is intended for integers and non-integer numbers. In other languages, such numbers require different data types.

Let’s now take a look at more complex or compound data types: array and object.

Compound types contain more than one value. The array array stores the sequence of values ​, ​and the order of these values ​​is important. The object object consists of a multitude of “key-value” pairs, and the order of these pairs is not important. These types of data are recorded as follows:

// Array [1, 2, 3, 4, 5] // Object {month: 'june', day: 15} // Logs array in the console console.log([1, 2, 3, 4, 5]); // Logs array in the console console.log({month: 'june', day: 15});

We will analyze each of these types of data later, in the courses that are still to come.