Reposting from

This will be a short post because it will set up for my next much longer post. Basically, I need to write a function that transpose an array. I’d like to use Ramda JS and ES6 syntax.

Of course, someone else already asked and several others already answered the question. But since an answer based on Ramda JS and ES6 has not been answered yet, I chime in.

Here’s my solution:

var transpose = a => {
return => {
return => {
return r[c];
}, a);
}, R.keys(a[0]));

var a = [

transpose(a) //=> [[1,5,9],[2,6,10],[3,7,11],[4,8,12]]

And here’s the playground that you can experiment with.