You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapters/Arrays.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -767,6 +767,32 @@ Apple
767
767
=> [1, 2, 1, 1, 2]
768
768
```
769
769
770
+
* use Enumerable methods `grep` and `grep_v` to filter elements based on `===` operator
771
+
* the `===` operator helps to check if an object will satisfy as a member of given condition
772
+
* if a block is passed, the given action is performed upon all the filtered elements, similar to `map` method that we'll see later on
773
+
* See [stackoverflow: What does the "===" operator do in Ruby?](https://stackoverflow.com/questions/4467538/what-does-the-operator-do-in-ruby) for more details
0 commit comments