RosettaCodeData/Task/Apply-a-callback-to-an-array/Fantom/apply-a-callback-to-an-array.fantom

10 lines
178 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
class Main
{
public static Void main ()
{
[1,2,3,4,5].each |Int i| { echo (i) }
Int[] result := [1,2,3,4,5].map |Int i->Int| { return i * i }
echo (result)
}
}