Skip to content

Instantly share code, notes, and snippets.

@robhinds
Created October 5, 2013 20:47
Show Gist options
  • Save robhinds/6845833 to your computer and use it in GitHub Desktop.
Save robhinds/6845833 to your computer and use it in GitHub Desktop.
def list = ['groovy', 'functional']
//This mutates the original list
list.add('programming')
//This creates a new list leaving the original unchanged
def newList = list.plus(2, 'programming')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment