2min chapter

Syntax - Tasty Web Development Treats cover image

Is JSDoc Better than TypeScript?

Syntax - Tasty Web Development Treats

CHAPTER

TypeScript: How to Type a Function in TypeScript

There's no type hinting in TypeScript for a thrown error, but you can just hover over top of the function and say, oh, okay, this throws a not found error. Another interesting thing that I can do that TypeScript straight, I can't do with that. It's return type, the function itself, all of the parameters with a one line comment above that functionThat could be imported from somewhere else. You have to export const load is equal to a function and then type that and then type the read. Well, I guess you're typing the function itself at that point. But the problem with that is that anytime you're copying and pasting stuff, you got

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode