# TypeScript for JavaScript Developers
TypeScript is JavaScript with a type system layered on top. Every valid JavaScript file is close to valid TypeScript — the shift is mostly about adding type information, not learning a new language.
## Basic Types
```typescript
let name: string = "Aarav";
let age: number = 24;
let isEnrolled: boolean = true;
```
## Typing Functions
```typescript
function calculateFee(base: number, discount: number): number {
return base - discount;
}
```
Typed function parameters and return values catch a huge class of bugs at compile time instead of runtime.
## Interfaces for Object Shapes
```typescript
interface Student {
name: string;
course: string;
enrolled: boolean;
}
```
Interfaces describe the shape of data flowing through your app — API responses, component props, function arguments.
## Type Inference
TypeScript doesn't require annotating everything. It infers types automatically in most cases:
```typescript
let count = 0; // inferred as number
```
Over-annotating obvious types adds noise without benefit.
## Common Early Mistakes
New TypeScript developers often reach for `any` to silence errors quickly, which defeats the purpose of using TypeScript at all. Using `unknown` instead forces you to narrow the type before using it safely.
## Gradual Adoption
TypeScript can be introduced file-by-file into an existing JavaScript project using `allowJs`, so teams don't need a full rewrite to start benefiting from it.
## Conclusion
TypeScript's real value shows up in larger codebases and teams, where catching type mismatches at compile time prevents entire categories of production bugs before they ship.
Back to Blogs
TypeScript for JavaScript Developers
A practical starting point for JavaScript developers learning TypeScript — what changes, what stays the same, and common early mistakes.
09 Aug 2026
6 min read