Converts the source to a record.
Type of items in the source.
Type of the key.
Type of the value.
Key selector function.
Value selector function.
Collector that converts the source to a record.
const result = toRecord<number, string, number>((x) => x.toString(), (x) => x * 2)([1, 2, 3]);console.log(result);// {// '1': 2,// '2': 4,// '3': 6,// } Copy
const result = toRecord<number, string, number>((x) => x.toString(), (x) => x * 2)([1, 2, 3]);console.log(result);// {// '1': 2,// '2': 4,// '3': 6,// }
Converts the source to a record.