@@ -0,0 +1,3 @@
|
||||
var words = ""
|
||||
["One", "Two", "Three"].each {|word| words = words + word }
|
||||
IO.print(words) // expect: OneTwoThree
|
||||
@@ -0,0 +1,3 @@
|
||||
var i = 0
|
||||
[].each {|item| i = i + 1 }
|
||||
IO.print(i) // expect: 0
|
||||
@@ -0,0 +1 @@
|
||||
[1, 2, 3].each("string") // expect runtime error: String does not implement 'call(_)'.
|
||||
Reference in New Issue
Block a user