Frontend & Design · Beginner
TypeScript
An enhanced version of JavaScript with type annotations added. It catches type mistakes while you're still writing, and large projects benefit most.
TL;DRIn 30 seconds
- JavaScript with a label on every piece of data saying whether it's a number or text.
- Once it's labelled, mistakes surface the moment you write them instead of at run time.
- It still has to be converted back to plain JavaScript before a browser will accept it.
OverviewIn detail
TypeScript, usually shortened to TS, is JavaScript with type annotations added. You can label your data — this is a number, this is text, this is a group of user records — and the tooling tells you immediately when you use the wrong type.
JavaScript is very free: the same variable can hold a number one moment and text the next without complaint, and once a project grows that turns into baffling faults. TypeScript drags those mistakes out into the open while you're writing, which makes a large project far more manageable.
Asking an AI to write a moderately complex piece of business logic tends to go more reliably in TypeScript. With the types spelled out, the AI is less likely to invent fields that don't exist, and when you change something the hints point you to everything it touches.
TypeScript is not JavaScript's rival but its beefed-up version. You write a little more to declare types, which slows the start slightly in exchange for fewer traps later.
Finished TS has to be converted to JS before it runs — browsers don't understand TS itself. So it doesn't replace JavaScript; it's a checking layer stacked on top of it.
Beginners often worry that type annotations make code wordy, but in most places the tooling infers the type by itself and you only add a note at the handful of spots that matter. The real nuisance isn't writing types — it's chasing down the hidden errors afterwards when you didn't.
MythsCommon misunderstandings
- ✕Thinking it's a separate language competing with JavaScript ✓It's that language with more annotation written in, nothing more
- ✕Thinking types only make code wordier ✓In most places the tooling works the type out by itself — you add a note only where mistakes are likely
- ✕Thinking you can just run it once written ✓A browser doesn't accept it — it has to be converted back to plain JavaScript first
In practiceWhere you will meet it
- Having the AI write a slightly complex piece of logic, where it's less likely to invent nonsense
- Taking over someone's project and, on changing one line, being told everything else it touches
- Seeing a file ending in .ts and knowing the project uses it
SummaryThe key points
- JavaScript with type annotations added
- Errors show up while you write, which steadies large projects
- It has to be converted to JavaScript before it can run
FAQ
What does TypeScript mean?
JavaScript with a label on every piece of data saying whether it's a number or text.Once it's labelled, mistakes surface the moment you write them instead of at run time.It still has to be converted back to plain JavaScript before a browser will accept it.
Where will I run into TypeScript?
Having the AI write a slightly complex piece of logic, where it's less likely to invent nonsense;Taking over someone's project and, on changing one line, being told everything else it touches;Seeing a file ending in .ts and knowing the project uses it。
What do people most often get wrong about TypeScript?
Thinking it's a separate language competing with JavaScript — but It's that language with more annotation written in, nothing more;Thinking types only make code wordier — but In most places the tooling works the type out by itself — you add a note only where mistakes are likely。
What are the key points about TypeScript?
JavaScript with type annotations added;Errors show up while you write, which steadies large projects;It has to be converted to JavaScript before it can run。
Common pitfalls TypeScript is an enhanced JavaScript, not a rival language.
Entry 100 of 186 · All entries
Keep readingRelated reading
UI(用户界面)
用户界面,指屏幕上你能看到、点到的一切:按钮、图标、配色和排版。它解决的是好不好看、点起来顺不顺手的问题。
UX(用户体验)
用户体验,指用一款产品从头到尾的顺畅程度:找得到、看得懂、操作顺。它管的不是好不好看,而是用起来顺不顺、累不累。
视觉设计(Visual Design)
指决定页面好不好看的那一层:配色、字体、图像和版式由它定。它还要用视觉手段替用户排出先看什么、后看什么。
JavaScript
The programming language that makes a web page move, click and respond. Almost every action you take on a page is answered in real time by it.
HTML(超文本标记语言)
网页的骨架,用标签标明哪是标题、哪是图片、哪是链接。所有网页都靠它搭出基本结构。
动效(Motion Design)
指界面里让元素动起来的细节:按钮弹一下、页面滑进来。它用来给操作即时反馈,让用户知道发生了什么。
Where to go nextExplore more
Back to the skills themselves
Most of the concepts covered here come from skills that install into your AI client with a single command.