I am trying to render a <li> which will print two to values in a single line. And then the third to value in the next <li>.
So my object is like this.
let obj = [
{from : 'a1' , to : 'a7'},
{from : 'b1' , to : 'b7',
{from : 'c4' , to : 'c27'},
{from : 'a1' , to : 'a9'},
{from : 'j1' , to : 'a10'}
]
I want to output it like
1. a7 , b7
2. c27, a9
3. a10
The obj is a react state. I am printing it using .map() function in js. But I want it to print in pairs of two. How can I achieve that.
moves.map((move, i) => {
return (
<li key={i}>{i}
{move}
</li>
)
})
