I am working on a Django app. I need to pass back a few parameters from the server, which I do with this code:

```
num_periods = 25    
num_traces = 2
opacities = [0.5, .99]
ys = [[1,2,3,4,5],[7,6,5,4,3]]

response = {'text' : request.POST['value'],
            'num_periods' : num_periods,
            'num_traces' : num_traces,
            'opacity': opacities,
            'ys': ys
           }

return JsonResponse(response)

```

On the client side, in the Ajax callback, I have code that looks like this:

```
    success : function(data) {
        console.log('num traces = ' + data.num_traces);
        console.log('opacitiees = ' + data.opacity);
        console.log('data = ' + data.ys);

```

but, `console.log(ys)` gives `data = 1,2,3,4,5,7,6,5,4,3`, which looks flattened.

However, if I do `console.log(ys[1])`, it 'looks like' an array: `7,6,5,4,3`, though with no brackets. So, JS is aware of the nested list structure.
But any attempt to get it into a list of lists of numbers fails. for example this code:

```
z=[]
z.push(ys[0])
z.push(ys[1])

```

gives me back `z = 1,2,3,4,5,7,6,5,4,3` when I do `console.log("z = " + z)`

Something deeply confusing is happening here. I also tried `Object.values(ys[0])`, but still this does not give a list. Other ideas I have seen are a clever use of slice like so : 

```
 var ys=[];
 while(list.length) ys.push(list.splice(0,5));
 console.log("ys[0]="+ys[0]);

```

which gives
 ys[0]=1,2,3,4,5,7,6,5,4,3

How do you take the JSON that was received from Python and get it to look like the basic list of lists that I clearly need? Stuffing '[' and ']' around things before assigning does no good...

What seems very confusing is that if I do a 'loopback' within Javascript by doing something like 

```
var foo = JSON.parse(JSON.stringify( { 'ys' : [[1,2,3],[4,5,6]]))

```

then things look better: the type of foo.ys is now `Array[ Array[5], Array[5] ]`. But the type of what I am getting with the actual Python-JS transfer is just that list of numbers, with type 'Object'.