Exercise

Exercise

  1. Right click to Download the file exersice13.1.html in the folder "yourNameWEB2JS". Open the file in your browser to see the results.
  2. Open the file in your editor, and replace the functions with arrow functions. We want to have the same results.

Answer:

//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(' ');