I have a list of games / arrays, which by default all Remember: all the games are This is an array of 30 items, each item has a unique On the back of this code, you see that the user who already created an item in a DB is Therefore, to do what I want, my guess: I have to put In the case of a bus: I am using Lodash and Konal checked = true
In this function, you can see this line intersectedSports = _.intersection (sportIds, sportChecked.sport);
where sportIds
is a complete list of game IDs and
check = true / code> By default.
id
, as I have stated that all the games are checked = true
, But I need to have id: 10
by default in the check = wrong
. check = wrong
, so you can see this line here game.checked =! _. (IntersectedSports, sport) ID;
. id: 10
to check = false
in Var = intersectedSports
which I have described above, unless you have a better suggestion for me ... So, what do you recommend to your friends?
Miscellaneous gameIDs = _.plak (game, 'id'), intersectionports = _ indian (sport id, sports checked .support); If (game.line) {game = _.map (play, function (game) {game.checked =! _ Contains (pseudo support, sport.id); return game;}); }
You can simplify the logic like this:
// Create a list of games that should be unchecked var uncheck = gamecacked .port .concat (10); // Add a checked property to each game _.each (game, function (game) {sport.checked =! _. (Uncontrolled, sport.id);});
No comments:
Post a Comment