Skip to content

Commit 53e7efd

Browse files
committed
Fixing ident
1 parent 4289548 commit 53e7efd

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ Functions that operate on other functions, either by taking them as arguments or
4141

4242
```javascript
4343
let sum = (x, y) => {
44-
return x + y;
44+
return x + y;
4545
}
4646

4747
let calculate = (fn, x, y) => {
48-
return fn(x, y);
48+
return fn(x, y);
4949
}
5050

5151
calculate(sum, 1, 2);
@@ -56,9 +56,9 @@ calculate(sum, 1, 2);
5656

5757
```javascript
5858
let students = [
59-
{name: 'Anna', grade: 6},
60-
{name: 'John', grade: 4},
61-
{name: 'Maria', grade: 9}
59+
{name: 'Anna', grade: 6},
60+
{name: 'John', grade: 4},
61+
{name: 'Maria', grade: 9}
6262
];
6363

6464
let isApproved = (student) => {
@@ -84,9 +84,9 @@ students.map(byName);
8484

8585
```javascript
8686
let students = [
87-
{name: 'Anna', grade: 6},
88-
{name: 'John', grade: 4},
89-
{name: 'Maria', grade: 9}
87+
{name: 'Anna', grade: 6},
88+
{name: 'John', grade: 4},
89+
{name: 'Maria', grade: 9}
9090
];
9191

9292
let isApproved = (student) => {
@@ -105,7 +105,7 @@ students.filter(isApproved).map(byName));
105105

106106
```javascript
107107
let totalGrades = students.reduce((sum, student) => {
108-
return sum + student.grade;
108+
return sum + student.grade;
109109
}, 0);
110110

111111
totalGrades
@@ -119,10 +119,10 @@ Whenever a function calls itself, creating a loop.
119119

120120
```javascript
121121
let countdown = (num) => {
122-
if (num > 0) {
123-
console.log(num);
124-
countdown(num - 1);
125-
}
122+
if (num > 0) {
123+
console.log(num);
124+
countdown(num - 1);
125+
}
126126
}
127127

128128
countdown(5);
@@ -139,11 +139,11 @@ countdown(5);
139139

140140
```javascript
141141
let factorial = (num) => {
142-
if (num <= 0) {
143-
return 1;
144-
} else {
145-
return (num * factorial(num - 1));
146-
}
142+
if (num <= 0) {
143+
return 1;
144+
} else {
145+
return (num * factorial(num - 1));
146+
}
147147
}
148148

149149
factorial(5);
@@ -172,7 +172,7 @@ Extract data from arrays or objects using a syntax that mirrors the construction
172172

173173
```javascript
174174
let foo = () => {
175-
return [1, 2, 3];
175+
return [1, 2, 3];
176176
};
177177

178178
let [a, b] = foo();
@@ -192,7 +192,7 @@ console.log(a, b);
192192

193193
```javascript
194194
let ajax = function ({ url = "localhost", port: p = 80}, ...data) {
195-
console.log("Url:", url, "Port:", p, "Rest:", data);
195+
console.log("Url:", url, "Port:", p, "Rest:", data);
196196
};
197197

198198
ajax({ url: "someHost" }, "additional", "data", "hello");
@@ -209,9 +209,9 @@ Taking a function that takes multiple arguments and turning it into a chain of f
209209

210210
```javascript
211211
let student =
212-
name =>
213-
grade =>
214-
`Name: ${name} | Grade: ${grade}`;
212+
name =>
213+
grade =>
214+
`Name: ${name} | Grade: ${grade}`;
215215

216216
student("Matt")(8);
217217
// Name: Matt | Grade: 8
@@ -221,9 +221,9 @@ student("Matt")(8);
221221

222222
```javascript
223223
let currySum =
224-
x =>
225-
y =>
226-
x + y;
224+
x =>
225+
y =>
226+
x + y;
227227

228228
let addFive = currySum(5);
229229
addFive(10);

0 commit comments

Comments
 (0)