Explore Library
Code QuizBeginner

Contextual Typing of Callback Parameters

An explicit callback parameter type overrides the correct contextually inferred type.

Codetypescript
const nums = [1, 2, 3];

nums.forEach((n: string) => {
  console.log(n.toFixed(2));
});

What is the bug in this callback?