When I receive arrays of objects structured like this, my goal is to iterate through them and concatenate a variable in order to create the following links:
link: `${id}/users`
link: `${id}/add-user`
...
id= school1;
dashboardMenu = [
{
title: "Dashboard",
icon: "home-outline",
link: "/",
home: true,
children: undefined,
},
{
title: "Users",
icon: "person-outline",
link: "/users",
data: "read:users",
children: [
{
title: "Users",
link: "/users",
data: "read:users",
},
{
title: "Create User",
link: "/add-user",
data: "create:users",
},
],
}
]