TypeScript uses Control Flow Analysis to provide better type inference, type narrowing, and error detection.
25 posts tagged with "javascript"
View All TagsUnderstanding `instanceof` Type Guard in TypeScript
In TypeScript, instanceof
is a type guard that allows you to narrow down the
type of an object within a conditional block.
Understanding `in` Operator Narrowing in TypeScript
In TypeScript, the "in" operator narrowing is a type narrowing technique that allows the type checker to refine the types of union types based on the presence of a specific property or key in an object.
Understanding Equality Narrowing in TypeScript
TypeScript compiler infer a more specific type based on the usage of
equality checks (e.g., ===
, !==
, ==
, !=
).
What are Generics in TypeScript?
TypeScript generics are a powerful feature that allows you to create reusable and flexible components, functions, and classes by defining them with a type variable.
Understanding Decorators and Decorator Factories in TypeScript
They are a powerful and expressive feature borrowed from the decorator pattern in other languages, such as Python.
Why are all Properties of an Object Enumerable in JavaScript?
All Properties of An Object Enumerable in JavaScript including Number Properties and here is why.
Mutability Vs Immutability In JavaScript
The concept of mutability and immutability in JavaScript is essential to understand to avoid errors.
Escape Sequence in JavaScript - A Few Unused Ones as Well
Simple escape characters that help you achieve small formatting tasks
In-depth Look Into The JavaScript Script Tag Attributes
The script tag has six attributes that are often underutilised and misunderstood by most JavaScript developers.