Data Types:

Data Types refer to the classification or categorization of data items based on the kind of value they represent and the operations that can be performed on them. They are fundamental concepts in programming, determining how data is stored, processed, and manipulated within a program. Understanding data types ensures efficient use of memory and proper handling of information.

Numbers:

These are used to represent numerical values. They can be integers (whole numbers) or floating-point numbers (decimals).

Example: 5, 3.14

Example: (from code)

this.pixels = ; //pixel offset of images in the sprite, set by liquid constant
      this.interval = 100; //animation time interval

Strings:

A string is a sequence of characters (letters, numbers, symbols) enclosed in quotation marks. They are used to represent text.

Example: “Hello, world!”, ‘123abc’

Example: (from code)

if (event.key === "ArrowRight") {
}

Booleans:

A boolean data type can only have one of two values: True or False. They are used for making decisions in conditional statements.

Example: True, False

Example: (from code)

if (event.repeat) {
}

Arrays:

Arrays (also called lists in some languages) are ordered collections of items, which can be of any data type (numbers, strings, etc.). They are useful for storing multiple values in a single variable.

Example: [1, 2, 3, 4], [“cat”, “cat1”, “cat2”]

JSON Objects:

JSON (JavaScript Object Notation) is a way of structuring data in a key-value pair format. It is often used for exchanging data between a server and a client in web applications. JSON objects can store multiple data types and even arrays within them.

Example: {“name”: “Cat”, “age”: 2, “isHuman”: false}