How to create role name from 2 different LDAP attributes

I have special requirements for user group/role names, where I need to concatenate 2 different LDAP attributes into the group/role name. Example:

"roles": [
  "<string><LDAP attribute 1><string><LDAP attribute 2>",

Of course I’m able to create mapper/LDAP filter, which will return list of LDAP attribute 1 and LDAP attribute 2. But I’m struggling how to concatenate them into desired format. Any idea how to write it? Maybe some example how to use mapper scripts?

Thx. I didn’t find how can I get user roles from ldap. My scripted mapper:

LDAPQueryConditionsBuilder = Java.type("");
LDAPUtils = Java.type("");
StorageManager =  Java.type("");
var PROVIDER_ID = "<ID>"; // ldap authentication component/provider id in realm
var userStorage = StorageManager.getStorageProvider(keycloakSession, realm, PROVIDER_ID);
var ldapQuery = LDAPUtils.createQueryForUserSearch(userStorage, realm);
var conditionsBuilder = new LDAPQueryConditionsBuilder();
var userDNCondition = conditionsBuilder.addCustomLDAPFilter("(&(|(objectclass=inetOrgPerson)(objectclass=organizationalPerson))(uid=USERID))");
var forEach = Array.prototype.forEach;, function(ldapObject) {

prints only my details, but not my roles from LDAP. How can I get LDAP roles list in the script mapper?