Skip to content

Commit 54cb001

Browse files
committed
Added the function conversion file and readme updates
- Added function-conversion.js - Updated readme
1 parent a44f4a9 commit 54cb001

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ With some basic JavaScript principles we can now expand our skills out even furt
99
* To test your `console` statements you can either run `node /assignments/<fileName>` and see what prints in your terminal. You can also use an online tool like `JSBin`, `REPL.it`, `JSFiddle` or even your `Chrome developer console`.
1010
* Once you finish the exercises in each file, commit your code, and push it to your fork.
1111

12+
### Function Conversion
13+
You will see more and more arrow functions as you progress deeper into JavaScript. Use the [function-conversion.js](assignments/function-conversion.js) file as a helper challenge to showcase some of the differences between ES5 and ES6 syntax.
14+
1215
### Array Methods
1316
Use .forEach(), .map(), .filter(), and .reduce() to loop over an array with 50 objects in it. The [array-methods.js](assignments/array-methods.js) file contains several challenges built around a fund rasising 5k fun run event.
1417

assignments/closure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ const counterFactory = () => {
1616
// Return an object that has two methods called `increment` and `decrement`.
1717
// `increment` should increment a counter variable in closure scope and return it.
1818
// `decrement` should decrement the counter variable and return it.
19-
};
19+
};

assignments/function-conversion.js

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)