-
-
Save sobbybutter/4f51d20b83bbe9a73b99 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
long_list = [["a", "0000"], ["b", "12345"], ["c", "6789"]] | |
short_list = ["b", "c"] | |
long_list.each_with_object([]) do |item,array| | |
if short_list.include?(item[0]) | |
array << item[1] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment