_mercury
_mercury2y ago

_mercury – 00-31 Sep 2

I have an array of objects ==> Object like photo {value:123, label: 'foo'} I want to use array.map to get only the value and rename the key to id ?
9 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
_mercury
_mercury2y ago
I did that ( no luck)
const attrs = selectedAttributes.map((attr) => ({
id: attr.value
}));
const attrs = selectedAttributes.map((attr) => ({
id: attr.value
}));
_mercury
_mercury2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
_mercury
_mercury2y ago
results
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
_mercury
_mercury2y ago
yes
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
reactibot
reactibot2y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1015056224204640346