Roles code not working

Hi everyone. I’m trying to make it so certain items on the page show up if you have a role. First step is to check and see if roles even are working with my code. I tried to set text80 to the user’s role. For some reason text80 is not showing the role. Why is this? Is there anything I could do to fix this?

My full code.

let user = wixUsers.currentUser;
 let userId = user.id;               // 
 let isLoggedIn = user.loggedIn;     // true
    console.log(user);
    console.log(userId);
    console.log("isLoggedIn = " + isLoggedIn );
    user.getEmail()
    .then( (email) => {

 let userEmail = email;          // "user@something.com"
        console.log(userEmail);
    } );
    user.getRoles()
    .then( (roles) => {
    $w("#text80").text = roles;
 let firstRole = roles[0];
 let roleName = firstRole.name;                // "Role Name"
 let roleDescription = firstRole.description;  // "Role Description"
        console.log (roles);
        console.log (firstRole);
        console.log (roleName);
        console.log (roleDescription);
    } );

The result of user.getRoles() is an array and you can’t assign an array to text elements. Only strings can be assigned to text elements.

Is there a way I can convert the array to a string or display the array visually in a different way?

@amelia3308 It’s not so clear what you mean. You can join the array element to one long string. Something like:

let roleString = role.join(", ");