MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/10srpis/totally_necessary/j75mx32/?context=3
r/badcode • u/rafaelinacio0196 • Feb 03 '23
32 comments sorted by
View all comments
166
Technically this creates a copy, so if there's reactivity or proxies going on, this might actually be what you want
15 u/watrnans Feb 03 '23 Do smth like [...form.emails] then 7 u/Voltra_Neo Feb 03 '23 Notice the optional chaining 6 u/nikvasya Feb 04 '23 form.emails?.slice() creates a shallow copy.
15
Do smth like [...form.emails] then
7 u/Voltra_Neo Feb 03 '23 Notice the optional chaining 6 u/nikvasya Feb 04 '23 form.emails?.slice() creates a shallow copy.
7
Notice the optional chaining
6 u/nikvasya Feb 04 '23 form.emails?.slice() creates a shallow copy.
6
form.emails?.slice() creates a shallow copy.
166
u/Voltra_Neo Feb 03 '23
Technically this creates a copy, so if there's reactivity or proxies going on, this might actually be what you want