OpenWGA 7.11 - TMLScript reference
WGA » WGA.List()Method :
filter(function)
On object | WGA.List() |
Usage |
Calls the function with each list element and returns the filtered 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 false, the value is not put into the resulting list. |
Return value |
WGAList object with filtered values. |
Allowed in script types |
|
Examples |
WGA.List([0,1,2,3]).filter(function(v){ return v > 0; }) // returns [1,2,3] |