title: encode and decode javascript objects to and from the string
body: <p>I want to use Javascript object as a key in the hashmap. In order to do this, I have to convert this Javascript object into the string. There also has to be a way to decode the object back from this string.</p>
  
  <p>What is the best way of doing this?</p>
  
  <p>So far I have found two ways of converting it. Using <a href="https://api.jquery.com/jQuery.param/" rel="nofollow">JQuery Params method</a> and JSON.stringify. </p>
  
  <p>Thanks.</p>