C.W.K.
Stream
Quiz · 3 questions

🧱 Primitives — The Base Types Everything Else Sits On

string, number, boolean, null, undefined, void, any, unknown, never, symbol, bigint, literal types

Level 0Curious
0 XP0/93 lessons0/23 achievements
0/100 XP to next level100 XP to go0% complete

Quiz

01What is the difference between any and unknown?
Hint
Try assigning each to a string variable. One compiles, one doesn't.
02Which scenario is never the correct type for?
Hint
Hover a throw new Error() inside a function. What does the editor say the function returns?
03What's the difference between null and undefined in TypeScript?
Hint
Try const x: string = null with strict mode on. Then try const x: string = undefined. Both fail — and the error message tells you which one you used.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.