In version 2.1, TypeScript introduced the object spread and rest operators, to bring support for the ES2017 and beyond. These operators are helpful additions to the syntax. In this video, look into the proper syntax and how we could use it.
- [Instructor] Type script introduced…the object spread and rest operators.…So it could bring support for the ES 2017 and beyond.…And as you'll see in a few seconds these operators…are helpful additions to the syntax.…In this video we'll look into the proper syntax…and how we could use it.…Let's get to it.…The first thing we'll do we'll create…creature called vreegKing.…And we'll assign it some properties.…So first of all we'll assign a size of 250.…
We'll put him in the Pacific Ocean.…And then we'll assign a snout property,…which will make it big.…Let's make sure we log this guy so we can…see what he looks like before we start doing anything.…Okay, so we'll start with rest.…What the rest operator allows us to do…is to create a new object and then remove…is to create a new object and then remove…or add anything from the previous object…that we're assigning to it so let me go ahead…and code it so you can make sense of it.…
What we'll do we'll remove snout from the vreegKing…and assign with the dot, dot, dot, a new object,…
Released
4/10/2017- Updating a local environment
- IDEs with TypeScript support
- Assigning null or undefined types
- Using control flow analysis
- Using tagged union types
- Using read-only properties
- Using mapped types
- Using objects spread and rest
- Leveraging external helper libraries
Share this video
Embed this video
Video: Objects spread and rest