Groovy web console

subscribe to the feed Subscribe
to this
site
list clone test (via #groovywebconsole)
tweet this snippet Tweet
this
script

list clone test

Published 3 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
list = [1, 2, 3]

list2 = list.clone()

assert list == list2

list2.pop()

assert list != list2