DEV Community

TypeScript Types Demystified: Simple Types, Special Types, and Type Inference (opens in new tab)

Discussed on DEV

TypeScript Types Demystified: Simple Types, Special Types, and Type Inference In the first By the end of this post, you'll know how to type variables, arrays, and function parameters correctly. You'll also understand the "special" types that trip up most beginners: any, unknown, never, and void. The Core Primitive Types TypeScript's basic types map directly to JavaScript's primitives: // string let firstName: string = "Ramesh"; let greeting: string = `Hello, ${firstName}`; // number (no separ...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help