I want to create an Immutable Set of paths. A path, in my case, is just an array of strings. So let's say we have the following paths.
var paths = [["a"], ["a", "b", "c"]];
I then create the Immutable Set like this
var selectedPaths = Immutable.Set(paths);
Although selectedPaths.first()
returns ["a"]
, I cannot understand why selectedPaths.contains(["a"])
returns false
.
EDIT: Well, I got an answer as to why this is happening, but I still cannot get it to work as I need it to.
SOLUTION: As @Alnitak has stated, I solved this by comparing a path to Immutable.List(["a"])
instead of a simple array