Articles tagged "Typescript"
TypeScript Class: Access Modifiers, Abstract Classes, and Parameter Properties
Classes in TypeScript get superpowers — private, protected, abstract, parameter properties.
TypeScript Try Catch: Typed Error Handling That Actually Works
Catch blocks type errors as unknown — and that's good. Here's how to narrow errors and handle async failures.
TypeScript String to Number: Every Way That Works (And NaN Traps)
Number(), parseInt(), unary + — all convert strings to numbers. But NaN lurks everywhere.
TypeScript Switch Statement: Type Narrowing and Exhaustive Checks
Switch in TypeScript narrows types. Discriminated unions, the never trick, and when switch beats if-else.
TypeScript Interview Questions That Actually Get Asked
The TypeScript questions interviewers love: any vs unknown, interface vs type, generics, type guards.
TypeScript Dictionary: Record, Index Signatures, and Map
No Dictionary type in TypeScript, but Record<string,T>, index signatures, and Map all fill the gap.
TypeScript Array: T[], Tuples, Readonly, and Typed Methods
Arrays in TypeScript get type inference on map, filter, reduce. Plus tuples and readonly arrays.
TypeScript For Loop: for, for...of, for...in With Proper Types
Looping in TypeScript means typed variables, iterable protocols, and knowing when for...in will betray you.
TypeScript Generics: Write Once, Type Everything
Generics are where TypeScript goes from helpful to powerful. Functions, constraints, defaults, and utility types.
TypeScript Function Types: Signatures, Overloads, and Generics
Typing functions in TypeScript goes way beyond (arg: string) => void. Call signatures, overloads, and more.
TypeScript typeof: Runtime Checks Meet the Type System
typeof in TypeScript does double duty — runtime type guards AND compile-time type extraction.
TypeScript forEach: Typed Iteration and Why You Can't Break Out
forEach in TypeScript types your callbacks automatically. But try to break out and you'll hit its biggest limitation.
TypeScript Interface: Shapes, Contracts, and the Type vs Interface Debate
Interfaces define the shape of your data — optional props, readonly fields, extending. Plus interface vs type.
TypeScript Enum: String, Numeric, Const, and When to Skip Them
TypeScript enums are powerful but controversial. String enums, const enums, and why some devs prefer union types.
TypeScript Map: Typed Key-Value Pairs Done Right
Map<K,V> in TypeScript gives you type-safe key-value storage that plain objects can't match.
Javascript Startswith — A Developer's Guide
A practical guide to javascript startswith with real code examples and tips from the trenches.
Javascript Check If Key Exists — A Developer's Guide
A practical guide to javascript check if key exists with real code examples and tips from the trenches.
Typescript Vs Javascript Differences — A Developer's Guide
A practical guide to typescript vs javascript differences with real code examples and tips from the trenches.
Typescript To Javascript — A Developer's Guide
A practical guide to typescript to javascript with real code examples and tips from the trenches.
Javascript Vs Typescript — A Developer's Guide
A practical guide to javascript vs typescript with real code examples and tips from the trenches.
Typescript Vs Javascript — A Developer's Guide
A practical guide to typescript vs javascript with real code examples and tips from the trenches.
Python Check If File Exists — A Developer's Guide
A practical guide to python check if file exists with real code examples and tips from the trenches.