def x = [ [a:1, b:2], [a:1, b:3], [a:2, b:4] ] def result = x.collect{it.a}println result
Standard input is empty
[1, 1, 2]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!