dmikester1 – 22-28 Jan 13
I have an array of objects. Each object has many fields, but I want to update the
linePosition
field in all of the objects. I simply want to decrement it by one. Would map
be my best bet here?3 Replies
If it matters, this array is a React state array.
You can simple do a loop
Oh, in this case use functional update with
.map()
to avoid state mutation
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/1063585356592717865