Created
October 5, 2013 20:47
-
-
Save robhinds/6845833 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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