User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
0 items

Results will appear here after applying a function.

Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

Batch-processing a list through a function is a fundamental operation in data manipulation, yet manual application across hundreds of values invites transcription errors and costs hours. This tool applies a selected transformation f(x) to each element x in your input list, returning the mapped output in O(n) time. It supports over 40 built-in mathematical, string, and type-conversion functions, plus a custom expression mode where you write raw JavaScript using x (current value) and i (index). Filtering functions like isPrime or isEven return boolean masks. Aggregation functions collapse the list into a single statistic. Note: custom expressions execute via new Function() with a capped iteration guard. The tool does not sandbox against all side-effects. Do not paste untrusted code.

list transformer map function array operations data processing apply function to list batch transform

Formulas

The core operation is a map transformation applied element-wise across an input list of length n:

output = [f(x0), f(x1), …, f(xnβˆ’1)]

For aggregation functions like mean, the result collapses to a scalar:

x = 1n nβˆ‘i=1 xi

Population variance used for variance:

Οƒ2 = 1n nβˆ‘i=1 (xi βˆ’ x)2

Custom expressions receive x (current value) and i (zero-based index) as parameters. The expression is compiled once via new Function('x','i', "return " + expr) and invoked per element. Factorial is computed iteratively: n! = n∏k=1 k, capped at n ≀ 170 to stay within IEEE 754 double precision range.

Reference Data

CategoryFunctionInput ExampleOutput ExampleNotes
Mathsquare525x2
Mathcube327x3
Mathsqrt164Returns NaN for negatives
Mathabsβˆ’77Absolute value
Mathfactorial6720Max n = 170
Mathlog1010003Base-10 logarithm
Mathln2.718≈1Natural logarithm
Mathexp27.389ex
Mathreciprocal40.251 Γ· x
Mathnegate5βˆ’5βˆ’x
Mathdouble8162 Γ— x
Mathhalve105x Γ· 2
Mathfloor3.73Round down
Mathceil3.24Round up
Mathround3.54Nearest integer
Mathsignβˆ’42βˆ’1Returns βˆ’1, 0, or 1
StringuppercasehelloHELLOLocale-aware
StringlowercaseWORLDworldLocale-aware
Stringcapitalizehello worldHello WorldEach word capitalized
StringreverseabccbaCharacter reversal
Stringlengthhello5Character count
Stringtrim hi hiStrips whitespace
StringslugifyHello Worldhello-worldURL-safe format
TypetoBinary101010Base-2 string
TypetoHex255ffBase-16 string
TypetoOctal810Base-8 string
TypetoCharCodeA65First char code
FilterisEven4TRUEDivisible by 2
FilterisOdd3TRUENot divisible by 2
FilterisPrime7TRUETrial division up to sqrt(n)
FilterisPositive5TRUEx > 0
FilterisNegativeβˆ’3TRUEx < 0
Aggregatesum[1,2,3]6Collapses to single value
Aggregatemean[2,4,6]4Arithmetic mean
Aggregatemedian[1,3,5]3Middle value (sorted)

Frequently Asked Questions

The expression you type is wrapped as the return value of a JavaScript function: new Function('x', "i", "return " + yourExpression). The variable x holds the current list element (auto-cast to a number if numeric), and i is the zero-based index. You can use any standard Math methods, e.g., Math.pow(x, 3) + i. The function is compiled once and invoked per element. A try-catch guards each call, so one failing element won't crash the entire batch - it returns an error marker for that position.
The tool attempts to parse each element via parseFloat(). If parsing fails (returns NaN), mathematical functions propagate NaN for that element, which is displayed as "NaN" in the output. String functions treat the raw string value. Filter functions like isEven return FALSE for non-numeric inputs. This preserves the positional mapping between input and output lists.
JavaScript uses IEEE 754 double-precision floats, which can represent values up to approximately 1.7976931348623157 Γ— 10308. The value 170! β‰ˆ 7.26 Γ— 10306 fits within this limit, but 171! overflows to Infinity. For arbitrary-precision factorials, a BigInt implementation would be required.
Map functions produce a one-to-one output: each input element yields one output element, preserving list length. Aggregate functions (sum, mean, median, min, max, count, range, variance, stdDev) collapse the entire numeric list into a single scalar result. The output area displays this single value with a label indicating the aggregation type.
The tool applies one function per execution. To chain, apply the first function, copy the output, paste it back as input, then apply the second function. Alternatively, use the custom expression mode to compose operations in a single pass, e.g., Math.round(Math.sqrt(x)) combines sqrt and round.
The parser accepts commas, newlines, semicolons, and tab characters as delimiters. Mixed delimiters within the same input are supported. Consecutive delimiters are treated as a single separator (empty elements are skipped). Leading and trailing whitespace around each element is trimmed. This means you can paste a column from a spreadsheet (newline-separated) or a CSV row (comma-separated) directly.