EDDYMENS

Published a year ago

How To Add Titles To Console.table Output

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 😊 How to allow users to be logged in forever | Laravel 10