gadenbuie / js4shiny

Companion Package for JavaScript for Shiny Users

Home Page:http://pkg.js4shiny.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update console.table() method in redirect for array of objects

gadenbuie opened this issue · comments

Currently an array of objects prints as Object [object] with numeric indices.

In an example like the following, it would be great to organize the object keys into columns and then print each object as a row.

const p1 = {first: 'Colin', last: 'Fay', country: 'France', twitter: '@_ColinFay'}
const p2 = {first: 'Garrick', last: 'Aden-Buie', country: 'USA', twitter: '@grrrck'}
    first      last country    twitter
1   Colin       Fay  France @_ColinFay
2 Garrick Aden-Buie     USA    @grrrck