I have array
with the workgroups that the session user belongs to, for example if I write like this:
return $data.teste02[0].group_id.name
It returns me the first group that this user belongs to, which in this case would be administrator
But there are cases that the user of the session will belong to more than one group, and I need to know all the workgroups it belongs to, so I thought I'd make a for
to access all groups, thinking about that I made the following code:
for (var x = 0; x <= $data.teste02.length; x++){
return $data.teste02[x].group_id.name;
}
But even so he only returns me the working group from the first position. If you have any idea how I can achieve this.