I have received a JSON.stringified Array of arrays in a variable named request.
alert(request);
When I alert the above, I get the following message:
"[[\"0\",\"MahaShivRatri\"],[\"0\",\"A Night with the Divine\"],[\"0\",\"Attend In-Person\"],[\"0\",\"11 March 2021\"],[\"0\",\"6 PM to 6 AM IST\"],[\"0\",\"Attend Mahashivratri celebrations with Sadhguru in the presence of Adiyogi at the Isha Yoga Center\"],............
Next, I try to parse this JSON string:
var arr = JSON.parse(request);
alert(arr);
When I alert a specific element of this Array:
alert(arr[0][1]);
The alert box shows undefined.
How can I properly extract an Array of arrays from a JSON.stringified Array of arrays?
Thank you.
Edits
1. The original full stringified request is this :
console.log(request);
logs this
"The full stringified request"
2. When I parse it and then log it:
var arr = JSON.parse(request);
console.log(arr);
This gets logged:
"The parsed array"
3. finally
console.log(arr[0]);
logs just this:
[