title: JavaScript convert an array of bytes to JSON and back
body: <p>I am having trouble converting a JSON string back to byte array. My byte array was converted to JSON string through JSON.stringify(bytes). If I use JSON.parse to convert the string back to JS, I only get an object, not an array any more.
  For example in the JS console:</p>
  
  <pre><code>&gt; var bytes = new Int32Array([101, 102, 103]);
  &gt; var s = JSON.stringify(bytes);
  &gt; s;
  "{"0":101,"1":102,"2":103}"
  &gt; var a = JSON.parse(s);
  
  &gt; a;
  Object {0: 101, 1: 102, 2: 103}
  </code></pre>
  
  <p>How can I get the original byte array back?</p>