Question: Background
----------

I have an array of arrays that represents a grid with the following format:

```
const grid = [
    [null, null, null, null, null, null, null],
    [null, null, null, null, null, null, null],
    [null, "®" , null, null, null, null, "®" ],
    ["©" , "©" , null, null, "©" , "®" , "®" ],
    ["®" , "®" , "®" , "©" , "®" , "©" , "©" ],
    ["®" , "©" , "©" , "®" , "©" , "®" , "©" ],
];

```

Objective
---------

My objective is to transform that array into the following:

```
const grid = [ 
    { row: 0, column: 1, value: null},
    { row: 0, column: 2, value: null},
    { row: 0, column: 3, value: null},
    //... some rows after ...
    { row: 3, column: 0, value: "©"},
    // etc...
];

```

Research
--------

My first idea was to use two nested `R.map`and the `R.chain` it. However I have a major problem: The ramda functions do *not* take indexes as parameters ( unlike the counter implementations in JavaScript ). 

So I believe that doing this exercise using ramda, is not possible. 

Question
--------

Is there a way to do this exercise using only ramda functions ( no for loops ) ?

Answer: 
Solution
--------

Using the solution from @sjahan The natural solution using Ramda is as follow:

```
const R  require("ramda");
const mapIndexed = R.addIndex( R.map );
const reduceIndexed = R.addIndex( R.reduce );

const convertGrid = reduceIndexed(
  ( acc, array, i ) => [...acc, ...mapIndexed( ( value, j ) => ( { row: i, column: j, value } ), array ) ],
  [ ]
);

```
A simple nested loop does it:

```
 const result = [];

 for(const [row, content] of grid.entries()) {
    for(const [column, value] of content.entries()) {
       result.push({ row, column, value });
    }
}

```