Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Vs Local Storage

I am new to HTML5. I want to know about the performance between Javascript Variable/Object and HTML5 Local storage.

Which one is the best in performance and memory wise. Could any one differentiate these two.

P.S. As for as i know, manually we need to clear the local storage where as javascript object automatically will be cleared when the page get refreshed.

Thanks.

like image 915
littledev Avatar asked Oct 19 '25 20:10

littledev


1 Answers

That are 2 different things.
HTML 5 Local Storage is used to save bigger data to the client. Sometimes used for making certain parts of websites to work offline.

  • http://diveintohtml5.info/storage.html

Javascript variables and Objects are programming code. I think that working with HTML Local Storage to save variables that are only used in JS Code locally is a waste of time and is much to slow for programming purpose.

like image 165
mas-designs Avatar answered Oct 22 '25 10:10

mas-designs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!