Skip to content

map documentation wrong #793

@mmikeyy

Description

@mmikeyy

Current documentation:

map<T extends IterableContainer, U>(
  fn: (value: T[number], index: number) => U,
): (data: T) => Mapped<T, U>
It returns the result of looping through iterable with fn.

It works with both array and object.

const fn = x => x * 2

const iterable = [1, 2]
const obj = {a: 1, b: 2}

const result = R.map(fn)(iterable),
// => [2, 4]

The function doesn't work with objects (use mapObject instead)

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