Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140071

Retrieve the value at a given string path in Ramda

$
0
0

Is there any built-in Ramda function to retrieve the value giving the path as a string? Like:

R.path('a.b', {a: {b: 2}}); // I want to get 2

I know that this is possible with path by using an array, like:

R.path(['a', 'b'], {a: {b: 2}});

I can split the path by . and then use it, but before doing it I'd like to know if there is a function already available.


Viewing all articles
Browse latest Browse all 140071

Trending Articles