I have an array like that
const arr = [ [1, 0], [0, 2], [0, 1], [0, 1] ]
I want to reduce it and get a new array. My aim is getting values of nested array by index. [[index(0)],[index(1)]
const new arr = [ [1,0,0,0] , [0,2,1,1] ]
I tried but I don't understand how i can it.