Groovy web console

subscribe to the feed Subscribe
to this
site
Increasing sublists with empty list (via #groovywebconsole)
tweet this snippet Tweet
this
script

Increasing sublists with empty list

Published 3 weeks ago by helpermethod
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def l = [1, 2, 3]

(0..l.size()).collect { n ->
    l[0..<n]
}