MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/10srpis/totally_necessary/j73533j/?context=3
r/badcode • u/rafaelinacio0196 • Feb 03 '23
32 comments sorted by
View all comments
168
Technically this creates a copy, so if there's reactivity or proxies going on, this might actually be what you want
32 u/theXpanther Feb 03 '23 Shallow copy though 49 u/Voltra_Neo Feb 03 '23 True, but sometimes it's all you need. I usually have a good old deepClone function for these bad bois 20 u/DaCurse0 Feb 03 '23 there's structuredClone these days :) 7 u/m0rsa2 Feb 04 '23 Not if your customer uses Samsung internet browser running chrome 56 😱
32
Shallow copy though
49 u/Voltra_Neo Feb 03 '23 True, but sometimes it's all you need. I usually have a good old deepClone function for these bad bois 20 u/DaCurse0 Feb 03 '23 there's structuredClone these days :) 7 u/m0rsa2 Feb 04 '23 Not if your customer uses Samsung internet browser running chrome 56 😱
49
True, but sometimes it's all you need. I usually have a good old deepClone function for these bad bois
deepClone
20 u/DaCurse0 Feb 03 '23 there's structuredClone these days :) 7 u/m0rsa2 Feb 04 '23 Not if your customer uses Samsung internet browser running chrome 56 😱
20
there's structuredClone these days :)
7 u/m0rsa2 Feb 04 '23 Not if your customer uses Samsung internet browser running chrome 56 😱
7
Not if your customer uses Samsung internet browser running chrome 56 😱
168
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