0 votes
in JavaScript by
How do you display data in a tabular format using console object in Javascript?

1 Answer

0 votes
by

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,

Screenshot Not: Remember that console.table() is not supported in IE.

...