javascript - underscore _.filter condition -


is possible using underscore _.filter?

self.getcols = function (columnid) { return cols = _.filter(self.model.cols(), function(c) {     return (             (c.id === self.model.id()) &&             ((columnid === undefined) ? '' : c.columnid === columnid)                ); });          

};

right condition i'm using on columnid not valid. sorry bad, edited in proper way.

in case return should (i think):

return c.columnid || c.id === self.model.id(); 

thats assuming 'columns specify' interpreted column id property equal self.model.id()


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -