Skip to content

Commit 24af335

Browse files
committed
adding arrow function stretch
1 parent 31b6ef9 commit 24af335

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ The [arrays.js](assignments/arrays.js) assignment takes us through a large data
2424
* Complete each challenge presented before moving on to stretch.
2525

2626
### Stretch
27+
28+
* [ ] Arrow Function Syntax - [Check out this awesome guide for ES6 arrow syntax](https://medium.freecodecamp.org/when-and-why-you-should-use-es6-arrow-functions-and-when-you-shouldnt-3d851d7f0b26). You will see more and more arrow functions as you progress deeper into JavaScript. Use the [stretch-function-conversion.js](assignments/function-conversion.js) file as a helper challenge to showcase some of the differences between ES5 and ES6 syntax.
29+
2730
* Move on to tomorrow's content and start studying callbacks, write a few of your own to get the hang of it.
2831
* Look at array methods like .map(), .reduce(), .filter(). use them on the data in the arrays assignment to accomplish the same things you did with the ES5 for loop.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Take the commented ES5 syntax and convert it to ES6 arrow Syntax
2+
3+
// let myFunction = function () {};
4+
5+
// let anotherFunction = function (param) {
6+
// return param;
7+
// };
8+
9+
// let add = function (param1, param2) {
10+
// return param1 + param2;
11+
// };
12+
// add(1,2);
13+
14+
// let subtract = function (param1, param2) {
15+
// return param1 - param2;
16+
// };
17+
// subtract(1,2);
18+
19+
// exampleArray = [1,2,3,4];
20+
// const triple = exampleArray.map(function (num) {
21+
// return num * 3;
22+
// });
23+
// console.log(triple);

0 commit comments

Comments
 (0)