const mapFrom Target Style export const mapFrom = (obj) => new Map(Object.entries(obj)) Converts an object into a map with a shorter, more natural name. Target style API. Preferred for new code. ParametersobjRecord<string, T> ReturnsMap<string, T>
const objectToMap Legacy Style export const objectToMap = (obj) => mapFrom(obj) Converts an object into a map of its enumerable entries. Legacy API. Kept for older code and not the preferred choice for new code. ParametersobjRecord<string, T> ReturnsMap<string, T> Exampleconst map = mapFrom({ foo: 1, bar: 2 })