In TS there is a trap for function’s return type
function a {
b();
}
function b {
// some operations
return typeC value
}
In the case above, the return type of function a would be void even though it finally returns value in typeC
To fix this problem, add a return before executing function b:
function a {
return b();
}
function b {
// some operations
return typeC value
}