array serialization with JSON2
HTML
<script src="https://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
JavaScript
var foo = [1, 2, 3, 'test', [1, 2, 3], 'test2']
bar = JSON.stringify(foo),
baz = JSON.parse(bar);
console.log('actual array - ', foo);
console.log('array.toString() - ', foo.toString());
console.log('JSON.stringify(array) - ', bar);
console.log('JSON.parse(string) - ', baz);