Join Alex Banks for an in-depth discussion in this video ES6 arrow functions, part of Building a Polling App with Socket IO and React.js.
- ES6 provides Arrow functions,…which are a shorthand way of declaring functions.…Arrow functions cannot only make your code look cleaner,…they automatically bind the scope of this for you,…which can help prevent errors.…Arrow functions are a natural solution…to simplify your code.…Let's examine how Arrow functions work.…Consider this function.…We are calling map on an audience array…and sending the callback with the arguments member…for each member in the audience array…in the index of that member within the array.…Now this particular map function…is returning just the member's name plus their index.…
Arrow functions are great for these array functions…because we can declare this exact same callback…using an Arrow function like this.…This is the same function.…The difference is, we don't have to use the function word…in the declaration, and we don't have to use…the return keyword either in the declaration.…Both of the arguments, member and i,…are supplied before the arrow.…And the arrow means let's create a function…
- Setting up the environment
- Connecting sockets
- Handling disconnects
- Setting up the React.js router
- Passing state to child components as properties
- Joining the presentation
- Starting and running the presentation
- Asking and answering questions
- Graphing results
- Upgrading to ES6
Skill Level Intermediate
Building a Responsive Single-Page Design with Sasswith Ray Villalobos4h 55m Intermediate
1. Setting Up the Environment
Setting up npm scripts4m 22s
2. Connecting Sockets
3. App State and Routes
4. Joining the Presentation
5. Starting the Presentation
6. Questions and Answers
7. Graphing Results on a Scoreboard
8. Upgrading to ES6 Syntax
Next steps1m 1s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.