Maps entries of the given object.

Type signature

<T, TResult>(f: (value: T, key: string, context: object) => TResult) => (xs: GenericObject<T>) => [string, TResult][]

Examples

mapEntries((x) => x ** 2)({
  a: 1,
  b: 2,
  c: 3,
});
// ⇒ [["a", 1], ["b", 4], ["c", 9]]
Try in REPL

Questions

  • How to map object entries?

TypeScript sourceJavaScript source