Data types guide
Numbers
Represents numeric values, which can be integers or decimals.In this guide, you will find some methods that you can use inside the function editor with number data.
Note
Go to Math formulas to better understand how to work with this type of data
Strings
Text strings represent sequences of characters, such as names, descriptions, messages, or any other type of textual information. In JavaScript, text strings are delimited by single ( ' ) or double ( " ) quotes. More information in this guide
Note
Go to Text formulas to better understand how to work with this type of data
Booleans (true and false)
Booleans represent logical values of true
or false
. They are essential for making decisions in your code and controlling the execution flow of your application.
Objects
An object is a data structure that stores information in key-value pairs. Each key is a unique identifier (a string) that points to a value, which can be of any data type (number, string, array, another object, etc.).
How to identify an object?
- It is written inside
{}
(curly braces). - Uses key-value pairs separated by colons
:
. - Keys are strings.
- Values can be any data type.
Creating an object
You can create an object using curly braces {}
and separating properties with commas. Each property has a key (name) and a value, separated by a colon :
. For example:
const person = {
name: 'John',
age: 30,
city: 'Madrid',
}; // Object created with name, age and city properties
return person;
You can check if a value is an object using:
return typeof person; // "object"
Accessing properties:
You can access the value of a property of an object using dot notation.
Modifying properties:
If you need to change the value of an existing property, you can assign a new value to its key. For example:
person.age = 31; // Updates the value of the property "age" to 31
Adding properties:
You can add new properties to an object by assigning a value to a new key. For example:
person.profession = 'Developer'; // Adds the property "profession" to the object
Arrays
An array is a data structure that stores multiple values in an ordered list. Each value is assigned a numeric index, starting from 0
.
How to identify an array?
- It is written inside
[]
(square brackets). - Elements are separated by commas.
- The order of elements is maintained.
Creating an array:
To create an array, use square brackets []
and separate the elements with commas. For example:
return (myShoppingList = ['apples', 'milk', 'eggs', 'bread']);
Accessing elements:
You can access a specific element in an array by using dot notation.
Modifying elements:
You can change the value of an existing element in an array by assigning it a new value using its index. For instance:
myShoppingList[1] = 'yogurt'; // Replace "milk" with "yogurt"
Types of content in an array
Arrays can contain different types of values, including:
- Numbers:
[1, 2, 3]
- Strings:
["apple", "banana", "cherry"]
- Booleans:
[true, false, true]
- Objects:
[{name: "Alice"}, {name: "Bob"}]
- Other arrays (Nested Arrays):
[[1, 2], [3, 4]]
Note
Go to array formulas to better understand how to work with this type of data