Skip to content

Commit 0132f56

Browse files
committed
Removing unnecessary parentheses
1 parent edbd400 commit 0132f56

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ increment();
2828
2) Pure
2929

3030
```javascript
31-
let increment = (n) => n + 1;
31+
let increment = n => n + 1;
3232

3333
increment(1);
3434
// 2
@@ -57,7 +57,7 @@ let students = [
5757
{name: 'Maria', grade: 9}
5858
];
5959

60-
let isApproved = (student) => student.grade >= 6;
60+
let isApproved = student => student.grade >= 6;
6161

6262
students.filter(isApproved);
6363
// [ { name: 'Anna', grade: 6 }, { name: 'Maria', grade: 9 } ]
@@ -66,7 +66,7 @@ students.filter(isApproved);
6666
3) Map
6767

6868
```javascript
69-
let byName = (obj) => obj.name;
69+
let byName = obj => obj.name;
7070

7171
students.map(byName);
7272
// [ 'Anna', 'John', 'Maria' ]
@@ -81,9 +81,9 @@ let students = [
8181
{name: 'Maria', grade: 9}
8282
];
8383

84-
let isApproved = (student) => student.grade >= 6;
84+
let isApproved = student => student.grade >= 6;
8585

86-
let byName = (obj) => obj.name;
86+
let byName = obj => obj.name;
8787

8888
students.filter(isApproved).map(byName);
8989
// ['Anna', 'Maria']
@@ -104,7 +104,7 @@ Whenever a function calls itself, creating a loop.
104104
1) Countdown
105105

106106
```javascript
107-
let countdown = (num) => {
107+
let countdown = num => {
108108
if (num > 0) {
109109
console.log(num);
110110
countdown(num - 1);
@@ -124,7 +124,7 @@ countdown(5);
124124
2) Factorial
125125

126126
```javascript
127-
let factorial = (num) => {
127+
let factorial = num => {
128128
if (num <= 0) {
129129
return 1;
130130
} else {
@@ -142,7 +142,7 @@ Given a value and a function, unwraps the values to get to its inner value(s), c
142142
1) Adding a value to all the elements in a array
143143

144144
```javascript
145-
let plus1 = (num) => num + 1;
145+
let plus1 = num => num + 1;
146146

147147
let numbers = [1, 2, 3];
148148
numbers.map(plus1);

0 commit comments

Comments
 (0)