Karthick S

Pick is a utility type that helps you create new types based on existing types by picking just the properties you are interested in.

Instead of redefining a whole new type, you can easily derive it from another one.

Just “pick” the props. See below for example

Tuples are arrays with a fixed length.

Sometimes it can be more convenient to work with tuples instead of objects.

You get the type-safety when using the index also.

Here’s a return type that gives us the weekday and its number. See below for example

--

--

Array Destructuring allows you to extract individual elements from an array with a readable syntax.

Instead of accessing elements individually , one by one you can get multiple at once.

Accessing values individually uses a lot of space. Let’s look at an example 👇🏻

Array destructuring is flexible. It uses less space and even allows you to ignore values. You can get the remaining elements as a new array. Let’s look at an example 👇🏻

--

--

Karthick S

Karthick S

Developer | Technical Writer | All things AWS | .Net