user3616287
user3616287

Reputation:

Mapping of key with another key value in localStorage

I want to know if there is any possibility of mapping between 2 different keys in localStorage.
For Instance :

Key 1: {'key1','value'}  
Key 2: {'key2','value'}

Is it possible to map to the existing key/value pair If the value of the key2 is same.
Edit: I don't want to save unnecessary repeated values to my localStorage.

Upvotes: 0

Views: 64

Answers (1)

Ian
Ian

Reputation: 34489

No, if you wish to do this it'll have to be in your code accessing storage. Local storage simply stores the content in a string format and therefore rich objects and reference sharing just isn't achievable, as within JSON etc. these will always be different objects that have identical properties.

Upvotes: 1

Related Questions