How To Add Titles To Console.table Output

Stripe Integration Freelance Gig external link
🔗 See other jobs

To output data in a table, you need to ensure your dataset comprises objects with keys and is packed within an array. Below is sample code showing what this looks like.


01: var userObject = [{
02:         firstName: 'John',
03:         lastName: 'Doe'
04:     },
05:     {
06:         firstName: 'Jane',
07:         lastName: 'Doe'
08:     },
09: ];
10: console.table(userObject);

console table screen shot

Here is another article you might like 😊 "Export CSV in Javascript"