title: How to store and update a localStorage key object which has properties of different data types?
body: <p>this is my first time using <code>localStorage</code> and I would like to store a <code>localStorage</code> key which is an object that has properties of different data types ,for example the key "<code>localstor</code>" ,it is an object containing two properties :  </p>
  
  <pre><code>localstor= { userMsg : String , userInfo : (Object) { ID: String , username: String , pwd :String } }
  </code></pre>
  
  <p>the property <code>userMsg</code> is of type <code>String</code> while the property <code>userInfo</code> is of type <code>object</code>.</p>
  
  <p>I know how to set and get an item containing only objects based on 
  <a href="https://stackoverflow.com/questions/13702100/localstorage-array-of-objects-handling">this question</a> , but in my case I don't know how to set and get this kind of key? and espacially if I want to update the object userInfo in localstor how to do that? </p>
  
  <p>Any help is appreciated. </p>