Last active
May 6, 2020 16:26
-
-
Save whiz25/377bab53856c1342dbba4ee4ccdc306f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- [ ] should be identical and returns the same thing as ruby's [`map`](https://ruby-doc.org/core-2.6.4/Enumerable.html#method-i-map). ([Screenshot](https://gitlab.com/microverse/guides/projects/requirements_screenshots/raw/master/images/ruby/advanced_building_blocks_enumerable/my_map.png) from [Odin](https://www.theodinproject.com/courses/ruby-programming/lessons/advanced-building-blocks#assignment-2)) | |
- [ ] returns a new array with the results of running block once for every element in enum. | |
```ruby | |
array = Array.new(100){rand(0...9)} | |
array.my_map(&block) == array.map(&block) # should return true | |
``` | |
- [ ] returns an Enumerator if no block is given | |
```ruby | |
array.my_map == Enumerator # should return true | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment