Key Concepts

+ Add Concept
JavaScript Closures

Closures

A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In JavaScript, closures are created every time a function is created, at function creation time.

Structural vs Nominal Typing

Structural Typing

TypeScript is a structurally typed language. This means that two types are compatible if they have the same “shape”, regardless of their names. In contrast, nominal typing (like in Java or C#) requires explicit inheritance or implementation for compatibility.

Questions (5)