ctrl + k
On This Page
Functions
Array Helpers
Array helpers provide utilities for working with arrays in templates.
Functions
join
Joins array elements with a delimiter.
Template Syntax
Parameters
Name | Type | Default | Description |
---|---|---|---|
array | array | [] | The array to join |
delimiter | string | ’ ‘ | The delimiter to use |
spaceAfter | boolean | false | Whether to add a space after the joined string |
Returns
string
- The joined string.
Example
joinComma
Joins array elements with commas.
Template Syntax
Parameters
Name | Type | Default | Description |
---|---|---|---|
array | array | [] | The array to join |
oxford | boolean | false | Whether to use Oxford comma |
quotes | boolean | false | Whether to wrap items in quotes |
Returns
string
- The comma-joined string.
Example
range
Returns an array with a range of numbers.
Template Syntax
Parameters
Name | Type | Default | Description |
---|---|---|---|
start | number | The start of the range | |
stop | number | The end of the range | |
step | number | 1 | The step between numbers |
Returns
array
- An array containing the range of numbers.