I am a beginner in Ts and I have encountered a confusing problem. Please help me solve it, thanks
function f1(x:number):void {
return x; // error
}
const f2:(s:number) => void = (s) =>{
return s // ok
}
way? In my opinion, they should behave consistently, and I have activated strict mode
New contributor
Billy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.