Skip to content

Instantly share code, notes, and snippets.

@chytreg
Created August 19, 2014 08:16
Show Gist options
  • Save chytreg/abcef0835971eb04da15 to your computer and use it in GitHub Desktop.
Save chytreg/abcef0835971eb04da15 to your computer and use it in GitHub Desktop.
console.log 'for in', "all: #{$scope.all}"
for user in $scope.participants
console.log user
user.checked_out_events[$scope.id].selected = $scope.all
console.log 'forEach', "all: #{$scope.all}"
_.forEach $scope.participants, (user) ->
console.log user
user.checked_out_events[$scope.id].selected = $scope.all
var user, _i, _len, _ref;
console.log('for in', "all: " + $scope.all);
_ref = $scope.participants;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
user = _ref[_i];
console.log(user);
user.checked_out_events[$scope.id].selected = $scope.all;
}
console.log('forEach', "all: " + $scope.all);
_.forEach($scope.participants, function(user) {
console.log(user);
return user.checked_out_events[$scope.id].selected = $scope.all;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment