-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
If part of the data looks like this
someArray : [
{ id : "A", value : "10" },
{ id : "B", value : "20" },
{ id : "C", value : "30" }
]can this part be transformed to
someObject : {
A : { id : "A", value : "10" },
B : { id : "B", value : "20" },
C : { id : "C", value : "30" }
}?
Maybe if the run function in an operate block gets passed the whole item you could do something like this
operate : [
{
run : function (val, item) {
item.someObject[val.id] = val;
return val;
},
on : "someArray"
}
]Just a naive idea basically but I wondered if there is a functionality already built-in. Mapping an Array into an Object is something I use very often.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels