Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

flatMap not working #263

@ghost

Description

I tried this example in the docs and the returned array isn't changed at all

var array = Immutable(["drop the numbers!", 3, 2, 1, 0, null, undefined]);
Immutable.flatMap(array, function(value) {
  if (typeof value === "number") {
    return [];
  } else {
    return value;
  }
});
// expected: ["drop the numbers!", null, undefined]
// reality: ["drop the numbers!", 3, 2, 1, 0, null, undefined]

I'm using seamless-immutable v7.1.4. Is this a bug or am I doing anything wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions