I want to take the array [1, 2, 3] and return [1, 2, 3, 1] .
I am using Ramda and I can get the desired result as follows:
const fn = arr => R.append(R.prop(0, arr), arr);
But I would like to do it for free. Here is the closest I got:
const fn = R.compose(R.append, R.prop(0)); fn(arr)(arr)
But it looks stupid. What am I missing? Thanks!
Andrew Burgess
source share