Skip to content

Commit

Permalink
Added the function conversion file and readme updates
Browse files Browse the repository at this point in the history
- Added function-conversion.js
- Updated readme
  • Loading branch information
BigKnell committed Apr 17, 2018
1 parent a44f4a9 commit 54cb001
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ With some basic JavaScript principles we can now expand our skills out even furt
* 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`.
* Once you finish the exercises in each file, commit your code, and push it to your fork.

### Function Conversion
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.

### Array Methods
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.

Expand Down
2 changes: 1 addition & 1 deletion assignments/closure.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ const counterFactory = () => {
// Return an object that has two methods called `increment` and `decrement`.
// `increment` should increment a counter variable in closure scope and return it.
// `decrement` should decrement the counter variable and return it.
};
};
23 changes: 23 additions & 0 deletions assignments/function-conversion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Take the commented ES5 syntax and convert it to ES6 arrow Syntax

// let myFunction = function () {};

// let anotherFunction = function (param) {
// return param;
// };

// let add = function (param1, param2) {
// return param1 + param2;
// };
// add(1,2);

// let subtract = function (param1, param2) {
// return param1 + param2;
// };
// subtract(1,2);

exampleArray = [1,2,3,4];
// const triple = exampleArray.map(function (num) {
// return num * 3;
// });
// console.log(triple);

0 comments on commit 54cb001

Please sign in to comment.