I am receiving an json object with user details from my api request in node, the library uses its own each function to iterate through the object and give the details. I am trying to access specific properties in the object using (.) notation. When I try user.profile I get only the profile which is great, however user.profile.UserProfile, gives me undefined. How can I access UserProfile? This is the code that iterates the object.
const orgUsersCollection = client.listUsers();
console.log(orgUsersCollection);
orgUsersCollection.each(user => {
console.log(user);
})
.then(() => console.log('All users have been listed'));
User {
id: '',
status: '',
created: '',
activated: null,
profile:
UserProfile {
firstName: '',
lastName: '',
login: '',
email: '' },
All users have been listed
user.profileis the property,UserProfileis the name of the object's class.