Arrow functions—often referred to as fat arrow functions—are a new syntax for writing functions in ECMAScript code. In this video, take a look at some common syntax rules and some common gotchas when working with arrow functions.
- [Instructor] Arrow functions have an abbreviated syntax … for working with functions. … We're dealing with a brand new token here. … An equals sign and a greater than sign. … And together that makes an arrow. … So don't get that confused with comparison operators … because it does something quite different. … Let's create a function here called studentList. … StudentList takes in some students … and then it logs those students to the console. … Now if I call studentList with an array, … it's going to log those values. … But arrow functions will allow me … to use a slightly shorter syntax. … So let's take a look at how I would refactor … this function to use an arrow function. … First I'd remove the function keyword. … Then students is our arguments, right? … So right after the arguments, … I'm going to place that arrow. … The way I think about it is it just points … to whatever this function returns. … Now this'll work as is with these curly braces. … But since there's only one statement, …
This course was created by Eve Porcello. We are pleased to offer this training in our library.
- What is ECMAScript?
- Writing and searching strings
- Writing maps
- Destructuring arrays
- Searching arrays
- Creating objects
- Destructuring objects
- Iterating with the for/of loop
- Getting and setting class values
- Using ECMAScript functions
- Building and returning promises
- Using async/await syntax
Skill Level Intermediate
1. What Is ECMAScript?
What is ECMAScript?1m 44s
2. ECMAScript Variables and Data Structures
3. Arrays and Array Methods
Destructuring arrays1m 34s
4. ECMAScript Objects
5. ECMAScript Functions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.