I have a two-dimensional array holding information which I need to save to local storage and then retrieve later. Here is my data:
var content_array = [
["0","Mobile Application Development","CT5006","01/14/2013","Note"],
["1","Java Programming","CT5005","01/16/2013","Note"],
["2","Multimeida Application Development","CT5011","02/13/2013","Note"]
];
Any easy way to turn this into a string then back into a 2D array?
Use the native JSON.stringify method:
var str = JSON.stringify(content_array);
You can then use the JSON.parse method to get it back into an actual array:
var content_array = JSON.parse(str);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With