Skip to content

Commit 5802886

Browse files
committed
I hope this works
1 parent 26f40a5 commit 5802886

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

assignments/function-conversion.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
// Take the commented ES5 syntax and convert it to ES6 arrow Syntax
22

3-
// let myFunction = function () {
4-
// console.log("Function was invoked!");
5-
// };
6-
// myFunction();
3+
let myFunction = () => {
4+
console.log("Function was invoked!");
5+
};
6+
myFunction();
77

8-
// let anotherFunction = function (param) {
9-
// return param;
10-
// };
11-
// anotherFunction("Example");
8+
let anotherFunction = (param) => {
9+
console.log(param);
10+
};
11+
anotherFunction("Example");
1212

13-
// let add = function (param1, param2) {
14-
// return param1 + param2;
15-
// };
16-
// add(1,2);
13+
let add = (param1, param2) => {
14+
console.log(param1 + param2);
15+
return param1 + param2;
16+
};
17+
add(1,2);
1718

18-
// let subtract = function (param1, param2) {
19-
// return param1 - param2;
20-
// };
21-
// subtract(1,2);
19+
let subtract = (param1, param2) => {
20+
console.log(param1 - param2);
21+
};
22+
subtract(1,2);
2223

2324

2425
// Stretch

0 commit comments

Comments
 (0)