mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
This lets us share functionality between List and Range (and other user-defined sequence types).
7 lines
136 B
Plaintext
7 lines
136 B
Plaintext
var a = [1, 2, 3]
|
|
var b = a.where(fn (x) x > 1)
|
|
IO.print(b) // expect: [2, 3]
|
|
|
|
var c = a.where(fn (x) x > 10)
|
|
IO.print(c) // expect: []
|