Build array of objects with specific column data

Build array of objects with specific column data

2008jackson2008jackson Posts: 38Questions: 9Answers: 0
edited September 2021 in Free community support

Greetings. Variable below is required to build an array of objects with data from columns 1 and 6. With configuration below, a single array is built. Kindly assist.

var allData = this.api().cells(this.api().rows, [ 1,6 ]).data().toArray();

Output for above is ["ABCD", 1, "EFGH", 2, "IJKL",3]
Desired output is [{"ABCD", 1}, {"EFGH", 2}, {"IJKL",3}]

Answers

Sign In or Register to comment.