Skip to content

Commit 0f5db73

Browse files
committed
filter example
1 parent 7e82ddd commit 0f5db73

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ operations to modify and/or get information about the collection. The operations
1616
First glance (finite Stream from an array):
1717

1818
```ruby
19-
array = [1, 2, 3, 4, 5]
19+
array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
2020
stream = Stream::FromArray.new(array)
2121
collected = stream
22+
.filter { |num| num % 2 == 0 }
2223
.skip(2)
2324
.collect
24-
puts collected # [3, 4, 5]
25+
puts collected # [6, 8, 10]
2526
```
2627

2728
More examples soon.

0 commit comments

Comments
 (0)