Skip to content

(PUP-7930) Update Array - Hash example#150

Merged
joshcooper merged 1 commit intomasterfrom
joshcooper_7390
Oct 27, 2020
Merged

(PUP-7930) Update Array - Hash example#150
joshcooper merged 1 commit intomasterfrom
joshcooper_7390

Conversation

@joshcooper
Copy link
Contributor

Array - Hash removes [key, value] entries in the hash from the array, similar to how Array + Hash adds [key, value] entries like:

   [1,2,3] + {a => 10, b => 20}    # => [1,2,3, [a, 10], [b, 20]]

Copy link
Contributor

@hlindberg hlindberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

[1,2,3] - 3 # => [1,2]
[1,2,b] - {a => 1, b => 20} # => [2]
[1,2,b] - {a => 1, b => 20} # => [1, 2, b]
[1,2[b,20]] - {b => 20} # => [1, 2]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[1,2[b,20]] - {b => 20} # => [1, 2]
[1,2,[b,20]] - {b => 20} # => [1, 2]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Thanks @hlindberg!

Copy link
Contributor

@lucywyman lucywyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with Henrik's suggestion!

Array - Hash removes [key, value] entries in the hash from the array, similar to how Array + Hash adds [key, value] entries like:

````
   [1,2,3] + {a => 10, b => 20}    # => [1,2,3, [a, 10], [b, 20]]
```
@joshcooper joshcooper merged commit 12b1ed7 into master Oct 27, 2020
@joshcooper joshcooper deleted the joshcooper_7390 branch October 27, 2020 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants