title: How to unserialize an array in Javascript
body: <p>I have arrays stored in files which have been serialized in php so that I don't have to explode/implode every time I use the data.<br>
  Is there a way by which i can unserialize and add a dimension to it in JS ?  </p>
  
  <p><b> the php equivalent would look like </b></p>
  
  <pre><code>$key = $_POST['num'];
  $array = unserialize(file_get_contents("file.data");
  $array[$key][0] = "marked";
  file_put_contents(serialize($array);  
  </code></pre>
  
  <p>the array <code>$key[0]</code> does not yet exist  but i don't know if it will affect the rest of the the code</p>