![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Of course, if you wish, you can define a new
version of sumUp
using the inject:into:
method:
Array method definition instance sumUp ^ self inject: 0 into: [:sum :element | sum + element] Workspace Transcript show: (Array with: 570 with: 720 with: 640 with: 720) sumUp printString Transcript 2650