Function Updated 30 May 2026
Array.forEach(callback)
Iterates all items in the array and executes a function passing the array item as a parameter.
Parameters
callbackfunctionrequiredFunction to execute for each item.
Returns
Nothing, executes a function for each item.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
#{ items.forEach(x => write(x)); }#The template above produces this output:
123The data the example runs with:
{
"items" : [1, 2, 3]
}