For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/fp/multiply.md.

multiply (Functional Programming) es-toolkit

Creates a function that multiplies its input by a number. Use it with pipe.

const result = pipe(value, multiply(multiplicand));
Info

This helper is specific to es-toolkit/fp. Use it when you want this operation as part of a pipe pipeline.

Usage

multiply returns a function that multiplies its input by multiplicand. It is designed for composition: it can transform the value flowing through a pipe, or serve as the callback of a function such as map.

import { map, multiply, pipe } from 'es-toolkit/fp';

// Transform the piped value.
pipe(3, multiply(2)); // => 6

// Use as a map callback.
pipe([1, 2, 3], map(multiply(3))); // => [3, 6, 9]

Parameters

multiplicandnumberrequired

The number to multiply the input by.

Returns

A function that maps value to value * multiplicand.

(value: number) => number
Source: es-toolkit

Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.