Storing Objects with Local Storage in JavaScript

preview_player
Показать описание
The limitations of using Local Storage in JavaScript is that you are only able to store data as Strings. In this video, I take you through how to work around this and make it possible to store complex objects with Local Storage.

We can achieve this by serializing (JSON.stringify) the object to store it, and then de-serializing (JSON.parse) it to access it again.

Check this out:

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

#dcode #javascript #webdev
Рекомендации по теме
Комментарии
Автор

I think this is the most basic explanation on local storage thank you. I have really been having a rough time getting my head around this simple concept. lol

Agustin-jomv
Автор

Thank you for making this breakdown and walk through! Super helpful.

erikdong
Автор

This explanation helped me A LOT, thanks!!!

silviatriscova
Автор

amazing breakdown, thanks for the straight forward explanation!

stardust
Автор

Simplest video of this topic I've seen, thanks!

raven.
Автор

Excellent explanation of local storage. Other videos I've watched really complicated it. Thanks!

xsocalxryan
Автор

here after you video on js classes, great content thanks

morchellemusic
Автор

I was stuck on figuring this out. Thanks for the help!

mikedev
Автор

Super clear and nice explanation. Thanks!

Ace_Qnemes
Автор

Damn you really care about naming variables xD

Great Video <3

pranitchavan
Автор

thanks bro so much, have a great week!

smurffronda
Автор

Seriously - great video! Super helpful.

BlakeLein
Автор

Short video but great content, I was stuck the why was it saying [Object object] but this helped a lot, Thanks! :)

aditgaur
Автор

Bravo ! Neat, clear, professional. Thx a lot.

angladephil
Автор

Thanks very much! Great video. simple and straight forward

AndrewOnTestingCars
Автор

what should you do if you wnat to display the value u stored in the storage ? which function would you use to display both name and age ?

NghiaTran-lpxh
Автор

Great video, helped me a lot! Thank you 💓💓👍👍

shvchnk
Автор

there is a problem when I store second object it replaces first object
may I know reason?

apnaelectronics
Автор

i made same things but my console says: localStorage is not defined...why?

yangus
Автор

Until when local storage will hold the data init?
Browser's cache is cleared?

amitj
join shbcf.ru