Avatar ·

TS7006 Error: Parameter implicitly has 'any' type in TypeScript

Hi! I started learning TypeScript and encountered an unclear error. I have simple code that filters an array of numbers: ```typescript const numbers = [1, 2, 3, 4, 5]; const evenNumbers = numbers.filter(function(item) { return item % 2 === 0; }); ``` TypeScript throws an error: `TS7006: Parameter 'item' implicitly has an 'any' type`. I don't understand why this happens — the `numbers` array clearly contains numbers, and TypeScript should infer that `item` is a number. I'm using strict mode (`strict: true` in tsconfig.json). Why does this error occur? How can I fix it? I tried explicitly specifying the parameter type as `(item: number)`, but that seems redundant. Maybe I misconfigured something in the configuration? I would appreciate a detailed explanation, preferably with