Elysia Tools
Navigation
Data Processing
From Pairs
· Last updated:2026-01-22
Convert array of key-value pairs to object using lodash _.fromPairs
Details
What this tool helps you do
Convert an array of key-value pairs into a single object.
Features:
- Accepts arrays of [key, value] pairs
- Creates an object from the pairs
- Handles various data types for values
- Supports string, number, and symbol keys
- Uses lodash _.fromPairs for reliable conversion
Examples:
- Input: [["a", 1], ["b", 2]] → Output: {a: 1, b: 2}
- Input: [["name", "John"], ["age", 30]] → Output: {name: "John", age: 30}
- Input: [[1, "one"], [2, "two"]] → Output: {1: "one", 2: "two"}
Use Cases:
- Object Construction: Build objects from pair arrays
- Data Transformation: Convert tabular data to object format
- Configuration Building: Create config objects from key-value lists
- Data Import: Convert imported pair arrays to objects
Execution
Run this tool
Fill in the form, run the tool, and review the result in one place.
Samples
Examples that match this tool
Related