Destructuring syntax is a way to extract multiple property values from objects, or multiple elements from arrays, with a single instruction. It is available in C# starting from v7.0, and was introduced to JavaScript by the ECMAScript 2015 specifications. TypeScript also makes destructuring available on previous JavaScript versions, by generating equivalent instructions. Moreover, it also extends destructuring to TypeScript tuples.
Destructuring may be used in variable definitions, assignments, and when passing values to a function; that is, wherever a value is assigned to a variable or parameter.
Let's create a new TypeScript file named DestructuringAndSpread.ts to test some examples on destructuring and spread. Then, as usual, add the JavaScript file obtained by transpiling DestructuringAndSpread.ts to any View of your web project.
...