...
Thanks to duck-typing, this would also work with other objects which support an add (plus() in Groovy) method, e.g.:
| Code Block |
|---|
accumulated = \[ "1", "2", "3", "4"\ ].inject("", addAll) println accumulated // => "1234" |
...
...
Thanks to duck-typing, this would also work with other objects which support an add (plus() in Groovy) method, e.g.:
| Code Block |
|---|
accumulated = \[ "1", "2", "3", "4"\ ].inject("", addAll) println accumulated // => "1234" |
...