Skip to content

2690. Infinite Method Object 👍

1
2
3
4
5
6
7
8
function createInfiniteObject(): Record<string, () => string> {
  return new Proxy(
    {},
    {
      get: (_, prop: string) => () => prop,
    }
  );
}