OpenWGA 7.6 - TMLScript reference
WGAMethod :
toList(value1, value2, value3 ...)
On object | WGA |
Usage | Converts any value into list form |
Description |
This method does the same list conversion known from itemList() or metaList() on a custom value. It is ensured that the return value is a non-null List with differing contents. The method builds a list from the given input values. For each input value the following applies:
|
Parameters |
value (Object): Any value to be converted to a list |
Return value | A List |
Allowed in script types |
|
Examples |
WGA.toList() can be flexibly used to convert anything to a list. You can use it with a JavaScript array as parameter: WGA.toList([1,2,3]) // List 1, 2, 3 You can also use it to construct a list by just giving all elements of it to the parameter list WGA.toList("a", "b", "c") // List a, b, c You can even use it to concatenate multiple collections: var theList = WGA.toList("a", "b"); var theArray = ["c", "d"}; WGA.toList(theList, theArray) // List a, b, c, d |