I am stuck with some issue with Json formatting in the script .Kindly help me and let me know where am I doing mistake:

 

 // Add your code here
 var pool_members_curr = {};
 var pool_members_ui = {};

 var device = '10.33.120.205';
 var pool_name = 'pool-tcp-443-ey-test-20.20.20.52';

 var request = {};

 var midserver = GlideProperties.get('mid.server.rba_default');

 var gr = new GlideRecord('ecc_agent');
 gr.addQuery('name', midserver);
 gr.query();
 gr.next();
 if (gr.status == 'Up') {
     var username = '';
     var password = '';
     var grCreds = new GlideRecord('sys_auth_profile_basic');
     grCreds.addQuery('name', 'F5 Lab');
     grCreds.query();
     var encr = new GlideEncrypter();
     if (grCreds.next()) {
         username_lab = grCreds.username.toString();
         password_lab = encr.decrypt(grCreds.password.toString());
     } else {
         gs.print('Failed to get credentials for "F5 Lab" auth profile.');
     }

     {
         username = username_lab;
         password = password_lab;
     }

     var r1 = new sn_ws.RESTMessageV2();
     r1.setHttpMethod('post');
     r1.setEndpoint('https://' + device + '/mgmt/shared/authn/login');
     r1.setRequestHeader('Content-Type', 'application/json');
     r1.setRequestBody('{"username":"' + username + '","password":"' + password + '","loginProviderName":"tmos"}');
     r1.setMIDServer(midserver);

     var response1 = r1.execute();
     var responseBody1 = response1.getBody();
     var httpStatus1 = response1.getStatusCode();
     if (httpStatus1 != 200) {
         throw new Error('Getting authentication token from ' + device + ' failed with HTTP Response status: ' + httpStatus1 + ' Response body:' + responseBody1);
     } else {
         var res_body_json1 = JSON.parse(responseBody1);
         var auth_token = res_body_json1['token']['token'];
     }


     var ritm = new GlideRecord('sc_req_item');
     ritm.addQuery('sys_id', '3f3d1c181ba9c294ae8c43f7cc4bcb5e');
     ritm.query();
     if (ritm.next()) {
         var mem_add_2 = [];
         var member_address = [];
         var mem_add_table = [];
         var add = ritm.variables.f5_active_device;
         var p_name = ritm.variables.pool_name;
         var mrvs_address = JSON.parse(ritm.variables.mvrs_f5_pmm);

         for (var i = 0; i < mrvs_address.length; i++) {
             var member = mrvs_address[i];
             var add_0 = member['name'];
             var member_add = member['address'];
             var add_2 = member_add + ':' + member['port'];
             pool_members_ui = {

                 'name': add_2

             };

             member_address.push(pool_members_ui + '');
             mem_add_2.push(member_add + '');
             gs.print('pool_members_ui' + member_address);
             gs.print('mem_add_2' + mem_add_2);


             var f5_pool_member = new GlideRecord('u_network_f5_pool_members');
             f5_pool_member.addEncodedQuery('u_f5_ipSTARTSWITH' + add);
             f5_pool_member.addQuery('u_pool_name', p_name);
             f5_pool_member.query();
             while (f5_pool_member.next()) {
                 mem_add_table.push(f5_pool_member.u_member_address + '');
             }

             gs.print('mem_add_table ' + mem_add_table);

             var arrayUtil = new ArrayUtil();

             var array3 = arrayUtil.diff(mem_add_table, mem_add_2);

             gs.print('array3 ' + array3);
             gs.print('array3 length ' + array3.length);

             if (array3.length == 0) {
                 gs.print('test');
                 request = {
                     'partition': 'Common',
                     'members': member_address

                 };

             }
         }


     }
     gs.print('StrINGIFY ' + JSON.stringify(request) );
 }