Groovy
#Notes
Use .getClass() after any variable to print the class.
Define lists and maps e.g. list = []
, map = [:]
You can either use dot notation or square brackets notation to reference the keys to get the values e.g. map.Key1
or map["Key1"]
##Closures
These are blocks of code which can be passed around in variables and passed to certain methods.
By default they take one variable called it.
square = { it * it }
println square(9)
[0,1,2,3].collect(square)
will perform the function square on each member of the list and return a new array