TS2448
error TS2448: Block-scoped variable ‘add’ used before its declaration.
Broken Code ❌
Function expressions cannot be hoisted (used before they are declared):
1 |
|
Fixed Code ✔️
Turn your function expression into a function declaration (which can be hoisted):
1 |
|