Saving Arrays and Object in Local Storage

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • This is a brief tutorial with an example on saving arrays and objects in local storage.

Комментарии • 29

  • @tiagocostarebelo9511
    @tiagocostarebelo9511 3 года назад +2

    Excelente, thank you so much. This video should be one of the firsts to pop up when we search for Local Storage, but its not. Took me a while to find a useful video, but i'm glad i find yours. Great job, thank you again.

  • @MrGarysjwallace
    @MrGarysjwallace 3 года назад +1

    The best to date!!- practical using J.stringing J. Parse.
    AI loves this tuff!! For API imput( 200)!!

  • @alexandersegovia8529
    @alexandersegovia8529 Год назад

    Excellent video!! Very practical and concise!

  • @tunghoang1700
    @tunghoang1700 Год назад

    nice video, thank you

  • @annikaausbremen4949
    @annikaausbremen4949 2 года назад

    Thank you very much for the very good explanation

  • @cypreanadie7424
    @cypreanadie7424 3 года назад +1

    Thanks a lot, this was really useful for me

  • @qual1481
    @qual1481 Год назад

    this is probably a long shot, but my local storage works fine, it saves, but my chrome doesnt show it. it appears when i use my laptop or another device, but on my desktop chrome browser when i check the local storage it doesnt appear, i cleared cache and hard refreshed chrome but not worked, any ideas? thanks!

  • @nikhilmourya4268
    @nikhilmourya4268 3 года назад +1

    Why this video is not on top search?? Thank you soo much buddy

    • @median-man
      @median-man  3 года назад

      Glad you found it helpful.

  • @salmanluxe800
    @salmanluxe800 3 года назад +1

    thank you sir , that's was very helpful

  • @dawnbroadbent
    @dawnbroadbent 2 года назад

    This overwrites the local Storage when you use it again. It doesn't add. Is it supposed to overwrite the local storage? How do you use the form to add multiple objects to local Storage?

    • @median-man
      @median-man  2 года назад

      You would want to store an array. Remember, local storage doesn't actually store objects. In order to store arrays or objects, the data must first be serialized as a JSON string, and that is what gets persisted in localstorage. Steps to add objects to an array in local storage: 1) Read data from local storage. 2) If data exists, parse the json to an array. 3) Push the new object containing form data to the array. 3) Serialize the array as JSON using JSON.stringify. 4) Persist the serialized data in localstorage.

  • @thearmor9231
    @thearmor9231 3 года назад

    Respect!

  • @otunmartins2414
    @otunmartins2414 2 года назад

    Very helpful!

  • @henilpatel9249
    @henilpatel9249 3 года назад

    Does it create a new array everytime the user inputs and clicks submit button?

    • @median-man
      @median-man  3 года назад

      Can you reference a time stamp so I can be sure I understand which part you are asking about?

  • @saying_thingsyt3584
    @saying_thingsyt3584 2 года назад

    Thank you

  • @sumi-p5660
    @sumi-p5660 2 года назад

    sir, can you pls tell how do i get unique id in localstorage?

  • @MrGarysjwallace
    @MrGarysjwallace 3 года назад

    Check Google on local storage !!- they don’t like local thru their Jquery.
    SessionStorage is less intrusive for them.

  • @omarkhaled9072
    @omarkhaled9072 Год назад

    Very Good

  • @mikaelfarro
    @mikaelfarro 2 года назад

    Legend

  • @otunmartins2414
    @otunmartins2414 2 года назад

    This channel has lots of good information but just 38 subscribers. We can help push this channel forward and help thus channel gain more visibility.

  • @danial8146
    @danial8146 2 года назад

    ty man

  • @binadarabzand2701
    @binadarabzand2701 3 года назад

    I did everything step by step. All the console.log() test were ok. Until creating carInfo object (11:54) . It just stopped working all together. It doesn't hit localStorage and gives no errors either.

    • @median-man
      @median-man  3 года назад

      Try making a codepen with your code and share it here. Maybe someone can help spot an issue. You could also try posting to stack overflow for help.

  • @atulsomkuwar5671
    @atulsomkuwar5671 Год назад

    You should at give atleast source code in description