OpenWGA 7.11 - TMLScript reference

WGA » WGA.List()
Method :

map(function)

On object WGA.List()
Usage

Calls the function with each list element and returns the resulting list as WGAList object for further method chaining.

Parameters

function

A JavaScript function to be called for each element.

The function is called with the current list element as parameter. If the return value is null, the value is not put into the resulting list.

Return value

WGAList object with new values.

Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples

WGA.List([1, 2, 3]).map(function(v){
return "Value " + v
}) // adds string "Value" to each element
//returns [Value 1, Value 2, Value 3]