New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set.concat Not working as expected on String's #1910
Comments
You are right that this is inconsistent. For the record, I suggest you to use The concat method takes one or several iterables as argument. As a string is an iterable of char, it does work. |
I think because javascript's array concat treats a string as a single item. e.g.
Your better off following the list behavour in Set as well because its more intuitive. |
You are right, and the immutable doc does explain this too !
So the List does handle passing values. We might update Set to be consistant with Javascript implementation The line that test it is this line : If argument has iterator and is not a string, so take it, instead do convert it into an array Line 145 in 803e8a9
|
When concatenating a new string Item into an existing set its treating the string as an array where as [].concat treats it as an item.
I would expect and prefer it to treat the string as an item.
Regards
Rod
The text was updated successfully, but these errors were encountered: