Is there any way to tell typescript that my function will always return?

as the title says is there any way to tell typescript that my function will return a type? because sometimes you cant add the default return at the end but you know that it will always return, not really a big problem, but then my function has a return type of Type | undefined which is kinda annoying
No description
4 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
PepeElToro41
PepeElToro41OP2y ago
it gives me an error expecting an end return
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
PepeElToro41
PepeElToro41OP2y ago
oh that works thank you

Did you find this page helpful?