We have a json array that has the form:
[
{id: 123, name: 'abc', symbol: 'xyz'},
{id: 456, name: 'def', symbol: null},
...
]
We are looking for a Ramda transformation that will replace all instances where the 'symbol' property is NULL, with a simple '' (empty string). Any ideas about how this can be done without getting into a forEach or for...next loop?
nullsymbol. Boom!map. If instead you said, I want to find only those..., you know you'll likely want tofilter. If you wanted to find the first one that matches, thenfind. If you want to combine them all into a single smooshed object, thenreduce. That will cover a great majority of your looping needs.