Created
December 6, 2016 01:44
-
-
Save mthadley/b0deb99ba9f2014128abcb25fbf4a1d2 to your computer and use it in GitHub Desktop.
concat vs union
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
const {OrderedSet} = Immutable; | |
const x = OrderedSet([]); | |
const y = OrderedSet([2, 3, 4, 5, 6]); | |
const z = x.concat(y); | |
console.log(z === y); | |
// This will log `false`. | |
// | |
// However if we call `union` instead, it will log `true`. | |
// | |
// I think both results make sense for their context, `concat` coming | |
// from Lists and `union` coming from Sets. I think we want to be | |
// calling `concat` most of the time here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment