eligius
    Preparing search index...

    Variable mapArrayConst

    mapArray: TOperation<
        IMapArrayOperationData,
        Omit<IMapArrayOperationData, "mapFunction">,
    > = ...

    Transforms each element of an array using a mapping function.

    Operates on arrayData passed from previous operations. The mapFunction receives each item and optionally its index.

    Operation data with mappedArray containing transformed elements

    // Double each number
    const result = mapArray({
    arrayData: [1, 2, 3, 4],
    mapFunction: (item) => item * 2
    });
    // result.mappedArray = [2, 4, 6, 8]
    // Extract property from objects
    const result = mapArray({
    arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],
    mapFunction: (item) => item.name
    });
    // result.mappedArray = ['Alice', 'Bob']
    // Use index in transformation
    const result = mapArray({
    arrayData: ['a', 'b', 'c'],
    mapFunction: (item, index) => `${index}-${item}`
    });
    // result.mappedArray = ['0-a', '1-b', '2-c']