title: Access objects in array list
body: <p>I am trying to access objects an arraylist using javascript, the arraylist is:</p>
  
  <pre><code>membersList:{
      "kind":"admin#directory#users",
      "users":[{"orgUnitPath":"/",
          "isMailboxSetup":true,
          "id":"1076823423424234",
          "isAdmin":false,
          "suspended":false,
          "isDelegatedAdmin":false,
          "isEnforcedIn2Sv":false,
          "etag":"\"npJcgsdfsadfsfsff\"",
          "ipWhitelisted":false,"changePasswordAtNextLogin":true,
          "customerId":"C01looera",
          "includeInGlobalAddressList":true,
          "lastLoginTime":"1970-01-01T00:00:00.000Z",
          "primaryEmail":"ilda.donofrio@domain.org",
          "isEnrolledIn2Sv":false,"kind":"admin#directory#user",
          "name":{"givenName":"ilda",
              "familyName":"donofrio",
              "fullName":"ilda donofrio"},
              "creationTime":"2018-06-10T11:56:45.000Z",
              "emails":[{"address":"ilda.donofrio@domain.org",
              "primary":true}],
              "agreedToTerms":true
              }],
          "etag":"\"npJcgsdfsadfsfsff/npJcgsdfsadfsfsff\"
  
      }
  </code></pre>
  
  <p>I am trying to access the <code>primary email</code> from this list for which I wrote a code i.e</p>
  
  <pre><code>for (var j in membersList) {
         var member = membersList[j];
         Logger.log('member Email:' + member);
      }
  </code></pre>
  
  <p>which just returns me </p>
  
  <pre><code>[18-06-12 15:39:55:982 EDT] member Email:admin#directory#users
  
  [18-06-12 15:39:55:982 EDT] member Email:{"orgUnitPath":"/","isMailboxSetup":true,"id":"1076823423424234","isAdmin":false,"suspended":false,"isDelegatedAdmin":false,"isEnforcedIn2Sv":false,"etag":"\"npJcgsdfsadfsfsff\"","ipWhitelisted":false,"changePasswordAtNextLogin":false,"customerId":"C01looera","includeInGlobalAddressList":true,"lastLoginTime":"1970-01-01T00:00:00.000Z","primaryEmail":"ilda.donofrio@domain.org","isEnrolledIn2Sv":false,"kind":"admin#directory#user","name":{"givenName":"ilda","familyName":"donofrio","fullName":"ilda donofrio"},"creationTime":"2018-06-10T11:56:45.000Z","emails":[{"address":"ilda.donofrio@domain.org","primary":true}],"agreedToTerms":true}
  
  [18-06-12 15:39:55:983 EDT] member Email:"npJcgsdfsadfsfsff/npJcgsdfsadfsfsff\"
  </code></pre>
  
  <p>When I tried with:</p>
  
  <pre><code>Logger.log('member Email:' + member.primaryEmail);
  </code></pre>
  
  <p>Its throwing:</p>
  
  <pre><code>[18-06-12 16:02:53:630 EDT] member Email:undefined
  [18-06-12 16:02:53:630 EDT] member Email:undefined
  [18-06-12 16:02:53:631 EDT] member Email:undefined
  </code></pre>
  
  <p>Is there a way to extract the value of just the <code>primaryEmail</code> using the script? I am a newbie to javascript and google scripts so please pardon me if its a stupid question.</p>