7 lines
262 B
Groovy
7 lines
262 B
Groovy
|
def words = ["Groovy", "ist", "cool"]
|
||
|
def lengths = words*.length()
|
||
|
def squares = numbers*.multiply(numbers)
|
||
|
|
||
|
println("Längen: $lengths") // Erwartete Ausgabe: Längen: [6, 3, 4]
|
||
|
println("Quadrate: $squares") // Erwartete Ausgabe: Quadrate: [1, 4, 9, 16, 25]
|