Sunday, 4 June 2017

how to filter table by underscorejs

i work by underscore function ,i want to filter table by element not exist in author table I want to finally display this [[10,20,30,50,60],[80,66],[9,70,4,3] ]

var tab=[];
             _.each([[10,20,30,5,50,60],[80,6,66,7,8,2],[9,70,4,3,1]], function (c) {

             var k=   _.filter(c, function (cel) {
                    return _.some([1, 2, 5, 6, 8, 7], function (el) {
                     return   cel != el

                    })
                })
                tab.push(k);
            });

console.log(tab)



via ahmed chega

No comments:

Post a Comment