Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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"

...