I have input like that:
{
a: [obj1, obj2, obj3...],
b: [obj1, obj2, obj3...],
c: [obj1, obj2, obj3...]
}
I want to have that output (only first object from array for every key)
{
a: [obj1],
b: [obj1],
c: [obj1]
}
I want to do it using ramda.js
The simplest answer is just
map(head, obj)
, or if you want a reusable function,map(head)
.You can see this in action on the Ramda REPL.