D
D
des1roer2017-07-23 16:32:59
JavaScript
des1roer, 2017-07-23 16:32:59

Underscore js loop through all elements of multidimensional array?

there is an object
EEwdu6ywQW2n8LDp9B6Uaw.png
how can i loop through all the columns and execute the function? For example

self.options['series'] = _.uniq(data, function(item, key, a) { 
                       return item.series;
                    });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Kornilov, 2017-07-23
@KorniloFF

var arr = ;
    var newArr = arr.map(function recur(el) {
      return !el.forEach? el * 3:  el.map(recur);
    })
console.log(newArr);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question