How do you list these in a list?

0

I have this list, which has 3 lists inside and I need everything to be a great list to be able to read each number with a for, how can I do it?
[[9.0, 2.0, 7.0, 5.0, 0.0, 5.0], [3.0, 5.0, 29.0, 1.0, 1.0, 1.0], [5.0, 18.0, 4.0, 4.0, 8.0, 4.0]]

    
asked by AXL 03.11.2018 в 06:24
source

2 answers

0

There is no special language, but I give you the basic idea:

     var arr = [[9.0, 2.0, 7.0, 5.0, 0.0, 5.0], [3.0, 5.0, 29.0, 1.0, 1.0, 1.0], [5.0, 18.0, 4.0, 4.0, 8.0, 4.0]];
     var nuevo = [];
     for(var i in arr){
       for(var j in arr[i])
       {
         nuevo.push(arr[i][j])
       }
     }

Result:

    
answered by 03.11.2018 в 07:33
0

d = [[9.0, 2.0, 7.0, 5.0, 0.0, 5.0], [3.0, 5.0, 29.0, 1.0, 1.0, 1.0], [5.0, 18.0, 4.0, 4.0, 8.0, 4.0]]

for x in d [0]:
    final.append (x)
for x in d [1]:
    final.append (x)
for x in d [2]:
    final.append (x) in this way I will make it easier

    
answered by 04.11.2018 в 01:50