littledev
littledev

Reputation: 189

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.

Upvotes: 3

Views: 1897

Answers (2)

Kevin
Kevin

Reputation: 1157

local storage is used for persisting data, for example, saving user preference data by using local storage.

so i think there is no comparison between local storage and JS Object

Upvotes: 1

mas-designs
mas-designs

Reputation: 7536

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.

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.

Upvotes: 5

Related Questions