i have to create 2 identical object, one with value 'home' and other with value 'mailing' if the condition is true I send them both otherwise I send only 'home', what can I do?
it's correct to do that?
var arrayObj = []
var reqBodyAddress = {};
    
    reqBodyAddress.startDate = new GlideDateTime(current.u_data_inizio_contratto).getNumericValue();
    reqBodyAddress.addressType = function(){
    var objAddressType1 = {
            home:'home'
        }
    var objAddressType2 = {
            mailing:'mailing'
        }
        if(current.u_domicilio == true){
            reqBodyAddress.addressType = objAddressType1 + objAddressType2;
            }else{
            reqBodyAddress.addressType = objAddressType1;
        }
    };
arrayObj.push(reqBodyAddress);
var sReqBodyData = JSON.stringify(arrayObj);
 
     
    