Edit this page

up.util up.util.map(list, block)
JavaScript function

Translate all items in a list to new array of items.

Parameters

list ListorIterator
block Function(element, index): anyorstring

A function that will be called with each element and (optional) iteration index.

You can also pass a property name as a String, which will be collected from each item in the list.

Return value

Array

A new array containing the result of each function call.