error TS7023: ‘
fibonacci‘ implicitly has return type ‘
any‘ because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
Broken Code ❌
Fixed Code ✔️
To avoid the implicit typing of
any for the return type, you have to add a return type annotation: