My function gets a string from a webservice, which represents a multi layered array structure. I then assign it to a variable. Something like this:
//incoming = [ [1,2,3], ['a','b','c'], [{v:1437, f:'1437 - Point A'}, {v:1440, f:'1440 - Point B'}, {v:1445, f:'1445 - Point C'}], [6.7,8.2,9.2] ] -- this is the incoming string
arrays = incoming;
When I try to pass this to another function, javascript always warns me that this is a string, not an array (which the function requires to split it up later to get the smaller arrays).
So far I tried this:
var globalArray = [];
$.each(arrays, function(key, object) {
var innerArray = [];
innerArray=object;
globalArray.push(innerArray);
});
But then the globalArray will not contain multiple arrays, but a lot of strings which will become siblings.
[ 1,2,3,a,b,c,{v:1437, f:'1437 - Point A'}, {v:1440, f:'1440 - Point B'}, {v:1445, f:'1445 - Point C'},6.7,8.2,9.2 ]
How could I recreate the array structure based on the content of the string?
a" in the array string?'[[1,2,3],["a","b","c"],["e","f","g"],[6.7,8.2,9.2]]'for it.