DEV Community

Discussion on: Storing Local Data with Javascript

Collapse
 
likejean profile image
likejean • Edited

Storing data in a declared array won't reserve your data in that array after you recompile the code again. If you don't involve any backend storage here and only looking for client-side storage, you would have to use some kind of browser-built Javascript APIs in order to save your data. The simplest and most widely supported is WebStorage where you have persistent storage (localStorage) or session based (sessionStorage). The Google has developed its own storage. There are plenty tutorials available how to store data locally.

Collapse
 
njericooper profile image
Njeri Cooper

Thanks! I'll look that up.