Deep cloning objects in JavaScript with structuredClone

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Coding Javascript for four years, and I never knew it before.

Thanks, steve. It's very useful.

izumiosana
Автор

Damn, these are some good stuffs. Thanks for sharing this amazing method

khoisida
Автор

structuredClone is super cool, but its a pretty new feature which means it's not really an option when you need to support older browsers. Sure you could pollyfill it, but then you're back to the same issue of increasing bundle size.

I should also mention that structuredClone is not part of the ECMAScript standard. So there is no guarantee that all runtimes will support this feature. Although, it appears that most of the popular ones do.

tryitpro
Автор

Man, every time I think I know everything about JS something like this pops up. And this feature is available since 2022? Damn!

serhiimamedov
Автор

OMG! Did not know this existed yet and have wanted it for ages

BenRangel
Автор

Finally! But because of backwards compatibility, I won’t be able to use it for another 5 years 😅

Vietnamkid
Автор

I've been struggling with this very issue, I've always used stringify and parse, but there has been cases that would not work, this is very practical, Thanks!

darkhistory
Автор

Why have I never heard of this? Seems like it has existed in all major browsers for almost a year!

JeyPeyy
Автор

Its one of these things that when you need it its so useful

albinopepegas
Автор

keep post short like this dude. you're awesome

ziberbee
Автор

Oh, this will be very useful to me when I get back to one of my app ideas

thecaffee
Автор

Finally, one of these videos where I didn't know!

blenderpanzi
Автор

Wow. clone deep was the only thing I kept lodash for. Thanks for info.

rahulgupta
Автор

You just earned my likes and subscription, you left me no option... Great job...

TarekFaham
Автор

Please, post more about native javascript as this language seems to me hiding a lot of secrets that a lot of libraries are taking advantage of to get popular.

ghostaccount
Автор

Damn thats good.
A question for your next short :D.
How do I see how many kb a node module has? (say when using React)
And maybe how to evaluate between investing the time in writing yourself or importing the module.

Greetings

luioskattusch
Автор

Incredibly useful. I wish I had known about this a long time ago

Poxen
Автор

this channel started to become so useful
subscribed

nomadshiba
Автор

Nice content. Been discovering some good QOL features

saiki
Автор

Useful info! I did not know about this. Thanks!

zirkzirk