JS || Обращение к элементу коллекции

144
08 сентября 2019, 23:20

У меня есть следующая коллекция:

Collection [Map] { 
  '339295220585725952' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '339295220585725952', 
       username: 'LiteEN✔', 
       discriminator: '6114', 
       avatar: 'c2b0f63d3f5124adeb64a115daaeedb2', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548595143452, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: false, 
    selfDeaf: false, 
    voiceSessionID: '53b2784cd1738563c2218942c1079c31', 
    voiceChannelID: '535913598766022678', 
    speaking: false, 
    nickname: 'Steven Hover', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '242705657835421698' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '242705657835421698', 
       username: 'nosok02(gigabyte)', 
       discriminator: '6061', 
       avatar: 'd599e4e7941c1af3527c51d720c07a1b', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1547843784110, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: false, 
    selfDeaf: false, 
    voiceSessionID: '6b772c49b1ad8527918b77f5af149ee4', 
    voiceChannelID: '535913598766022678', 
    speaking: false, 
    nickname: 'Jordan Piterson', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '210037338003210243' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '210037338003210243', 
       username: '[R-LV] Colin_Rose [3]', 
       discriminator: '7216', 
       avatar: '0e1d1a69ea8b49a024247626ca55e2cf', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548786272205, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: false, 
    selfDeaf: false, 
    voiceSessionID: '828fb1cb5b3426d19a078f4d3622695e', 
    voiceChannelID: '535913598766022678', 
    speaking: false, 
    nickname: null, 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '307914992152477706' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '307914992152477706', 
       username: '[$FARMER$][Мин. Юст.]Gans_Miller', 
       discriminator: '3598', 
       avatar: '2d1311aa9e4f0694655d82103290296e', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548603461889, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: undefined, 
    selfDeaf: undefined, 
    voiceSessionID: undefined, 
    voiceChannelID: undefined, 
    speaking: false, 
    nickname: 'Gans Miller', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '319392609460158464' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '319392609460158464', 
       username: 'Fire_Ice', 
       discriminator: '7090', 
       avatar: '2bfa470a93178981d234300e769dc580', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548609766152, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: undefined, 
    selfDeaf: undefined, 
    voiceSessionID: undefined, 
    voiceChannelID: undefined, 
    speaking: false, 
    nickname: 'Oleg Avramenko', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '320652579455631363' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '320652579455631363', 
       username: '!Клайд', 
       discriminator: '1316', 
       avatar: 'baeadc5c1eca15c41d77fed7fc0cb2b1', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548610195271, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: undefined, 
    selfDeaf: undefined, 
    voiceSessionID: undefined, 
    voiceChannelID: undefined, 
    speaking: false, 
    nickname: 'Clyde Capone', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '332805879378477056' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '332805879378477056', 
       username: 'Шариз', 
       discriminator: '5288', 
       avatar: '14de64a4742b2a341d48a6d38991d23c', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548609863917, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: undefined, 
    selfDeaf: undefined, 
    voiceSessionID: undefined, 
    voiceChannelID: undefined, 
    speaking: false, 
    nickname: 'Frank Village', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '379677386834182145' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '379677386834182145', 
       username: '∆ √Drek_Barrosa √', 
       discriminator: '0725', 
       avatar: '2c8d7d4b133fe6ff0b8b571d1290e4ea', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548605781196, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: undefined, 
    selfDeaf: undefined, 
    voiceSessionID: undefined, 
    voiceChannelID: undefined, 
    speaking: false, 
    nickname: 'Drek Barrosa', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '383306579245531139' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '383306579245531139', 
       username: 'Андрей Дарт', 
       discriminator: '7120', 
       avatar: '82216f9a96c2d11423775620a97d7aab', 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548587971013, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: undefined, 
    selfDeaf: undefined, 
    voiceSessionID: undefined, 
    voiceChannelID: undefined, 
    speaking: false, 
    nickname: 'Andrii Darth', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false }, 
  '434717173810724864' => GuildMember { 
    guild: 
     Guild { 
       members: [Collection], 
       channels: [Collection], 
       roles: [Collection], 
       presences: [Collection], 
       deleted: false, 
       available: true, 
       id: '534791311434448897', 
       name: '#Scottdale || Парламент', 
       icon: '85ea87471a6a921ddb3f7f38c3a37b70', 
       splash: null, 
       region: 'eu-central', 
       memberCount: 14, 
       large: false, 
       features: [], 
       applicationID: null, 
       afkTimeout: 300, 
       afkChannelID: null, 
       systemChannelID: '534791311434448901', 
       embedEnabled: undefined, 
       verificationLevel: 0, 
       explicitContentFilter: 0, 
       mfaLevel: 0, 
       joinedTimestamp: 1547864050757, 
       defaultMessageNotifications: 'ALL', 
       ownerID: '347827337137750016', 
       _rawVoiceStates: [Collection], 
       emojis: Collection [Map] {} }, 
    user: 
     User { 
       id: '434717173810724864', 
       username: '[KFC] Danil_Kartery [РМ] [VIPL]', 
       discriminator: '9866', 
       avatar: null, 
       bot: false, 
       lastMessageID: null, 
       lastMessage: null }, 
    joinedTimestamp: 1548605906833, 
    _roles: [ '535915484768501781' ], 
    serverDeaf: false, 
    serverMute: false, 
    selfMute: undefined, 
    selfDeaf: undefined, 
    voiceSessionID: undefined, 
    voiceChannelID: undefined, 
    speaking: false, 
    nickname: 'Danil Kartery', 
    lastMessageID: null, 
    lastMessage: null, 
    deleted: false } }

Я хочу получить все id пользователей. Они находятся в user: User{id: 'id'}. Как я могу к ним обратиться?

READ ALSO
Как можно увеличить значение символа в JS

Как можно увеличить значение символа в JS

Можно ли как, допустим, в C++ применить какие-то операции с символом, чтобы он шёл дальше по алфавиту?

116
Redux вывод нескольких state вызывает undefined

Redux вывод нескольких state вызывает undefined

есть хранилище и один reducer При вызове 2 action SHOW_POSTS и SHOW_TODOS, post выводятся в консоль а todos выводит undefined, я понимаю что state переопределяет объект,...

126
Angular 6 и Yandex Map API

Angular 6 и Yandex Map API

хочу в темплейте у балуна карты вызвать (click)="open()" но метод open не вызываетсяВ чем причина?

126