From the course: Learning Functional Programming with JavaScript ES6+
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
The spread operator - JavaScript Tutorial
From the course: Learning Functional Programming with JavaScript ES6+
The spread operator
- [Instructor] ES6 offers many syntax improvements over its predecessor CommonJS. In addition to arrow function syntax, which we covered in a previous video, and import export statements, ES6 provides us with a new syntax that's really helpful for dealing with JavaScript objects and arrays. Something that we do a lot of when doing functional programming in JavaScript since these are the main ways that our data is represented in code. This new syntax is called spread operator syntax. To see what the spread operator syntax looks like and how it works, let's imagine that we have two objects. The first object represents a person. We have their name, their age and their hair and eye color. The second object represents career data that we might have about the person. Their job title and the company they work for. What if we wanted to combine these two objects into one object that had all the same properties and values as these two objects? Well, that's exactly what the spread operator helps…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
JavaScript: Functional parts1m 53s
-
(Locked)
The spread operator5m 30s
-
Mapping5m 11s
-
(Locked)
Filtering6m 59s
-
(Locked)
Every/some5m 46s
-
(Locked)
Slicing3m 38s
-
(Locked)
Sorting5m 11s
-
(Locked)
Reducing6m 23s
-
(Locked)
Combining functions6m 40s
-
(Locked)
Challenge: Recreate the map function1m 3s
-
(Locked)
Solution: Recreate the map function3m 6s
-
(Locked)
-
-
-