Iterables

Create, read, and transform arrays and strings.

iterables_string
// A piece of text
"";
View on MDN ↗
array
// Create an array (list) of values
new Array(0, 0);
View on MDN ↗
length
// Get the number of items in an array
[].length;
View on MDN ↗
reverse
// Reverse the order of an array
[].reverse();
View on MDN ↗
join
// Join the items of an array into text
[].join(", ");
View on MDN ↗
includes
// Check whether an array contains a value
[].includes(null);
View on MDN ↗
slice
// Get a section of an array between two indexes
[].slice(0, 2);
View on MDN ↗
item
// Get the item at a given index of an array
[][0];
View on MDN ↗
indexOf
// Get the position of a value within an array
[].indexOf(null);
View on MDN ↗
foreach
// Run code for each item in an array
for (const item of []) {
}
View on MDN ↗