Last active
May 13, 2016 17:18
-
-
Save wellington1993/94b2092470888f48e05ef8bcb7671522 to your computer and use it in GitHub Desktop.
Tests with Lodash array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Subtract the $scope.mission.astronauts array from all_astronauts array. | |
//The Astronaut inside all_astronauts are different as $scope.mission.astronauts astronaut | |
// but have some id | |
mission_astronauts_ids = _.map($scope.mission.astronauts,"id") | |
diff_astronauts = _.filter(all_astronauts, function(astronaut){ | |
return mission_astronauts.indexOf(astronaut.id) >= 0 | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment