OpenWGA 7.10 - 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 th 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]