jdougan
Joined 17 years ago
Karma
1,389
Submissions
578
Member since
Dec 5
Joined 17 years ago
And it seems to me they will continue to to unlikely to meet it if they don't get any practice at it. Which loops back to being another pedagogical problem.
bsnpApproved := tvShows reject: [ :eachShow | eachShow hasNaughtyContent ].
#(1 2 3 4 5 6 7) inject: 10 into: [ :sum :each | sum + each squared ].
or from your example:
someHash := myArray inject: (Dictionary new) into: [ :accumulator :item | ... ].
The way I remember the order is it reflects the assignment you'd do is a while loop, sum := sum + each.
https://hnbadges.netlify.app/?user=jdougan