FrontendDeveloper.in

JavaScript question detail

How do you display data in a tabular format using console object

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.

Back to all JavaScript questions
Get LinkedIn Premium at Rs 399