Book
Submodule 13.1: Introduction to ES6
Submodule 13.1: Introduction to ES6
Completion requirements
View
- Let vs Var
- Advantages of let
- Arrow functions
Exercise
Exercise
- Right click to Download the file
exersice13.1.html
in the folder "yourNameWEB2JS". Open the file in your browser to see the results. - Open the file in your editor, and replace the functions with arrow functions. We want to have the same results.
//Example 1
let setNameIds = (id, name) => ({ id: id, name: name });
//Example 2
let multiply = (x, y) => { return x * y };
//Example 3
let phraseSplitter = phrase => phrase.split(' ');