Recipe 16.4
Displaying Data in a Table
Demo
Open the console to see output.
Code
JavaScript
const users = [
{ firstName: "John", lastName: "Smith", department: "Sales" },
{ firstName: "Emily", lastName: "Johnson", department: "Marketing" },
{ firstName: "Michael", lastName: "Davis", department: "Human Resources" },
{ firstName: "Sarah", lastName: "Thompson", department: "Finance" },
{ firstName: "David", lastName: "Wilson", department: "Engineering" }
];
console.table(users);
HTML
Open the console to see output.