struct.map()
Calls the given closure with every element in the given struct.
The function returns a struct that contains all values returned by the closure.
struct.map( closure=function, parallel=boolean, maxThreads=number )
Returns: Struct
Examples
original = {
"one": {
1: "map"
},
"two": {
2: "struct"
},
"three": {
3: "mapstruct"
},
"four": {
4: "structmap"
}
};
function mapOriginal(k,v) {
return v[ListFirst(v.keyList())];
}
fixed = original.Map(mapOriginal);
writeDump([original, fixed]);