The console.table()
is used to display data in the console in a tabular format to visualize complex arrays or objects.
const users = [
{ name: "John", id: 1, city: "Delhi" },
{ name: "Max", id: 2, city: "London" },
{ name: "Rod", id: 3, city: "Paris" },
];
console.table(users);
The data visualized in a table format,
Not: Remember that console.table()
is not supported in IE.