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

javascript - Can Piwik report referrer in real time? -

asp.net - Google Drive Access: At least one client secrets (Installed or Web) should be set -

excel vba add hyperlink to shape in group -