When running this code snippet in Typescript:
[].map(JSON.stringify);
An error is being thrown:
Argument of type '{ (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | ... 1 more ... | undefined): string; }' is not assignable to parameter of type '(value: never, index: number, array: never[]) => string'. Types of parameters 'replacer' and 'index' are incompatible. Type 'number' is not assignable to type '((key: string, value: any) => any) | undefined'.
This seems like a potential bug with Typescript. However, I would appreciate it if someone could verify whether I am making a mistake before I raise an issue on GitHub.
Current Typescript version being used: 3.0.3