const testUsers = [
{ id: 1, name: "Admin", role: "ADMIN", active: true },
{ id: 2, name: "Tester", role: "QA", active: true },
{ id: 3, name: "Guest", role: "VIEWER", active: false },
];// Extract usernames with map:
const usernames = testUsers.map(u => u.name);
// Filter active users:
const activeUsers = testUsers.filter(u => u.active);
// Check if any admin exists:
const hasAdmin = testUsers.some(u => u.role === "ADMIN");
// JSON serialization:
const jsonString = JSON.stringify(testUsers);
const parsedData = JSON.parse(jsonString);