Skip to content

Commit a6d200c

Browse files
committed
Fix code style
1 parent ffb34eb commit a6d200c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

JavaScript/9-forEach.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ numbers.forEach((item, i, arr) => {
55
console.log(i, arr, item);
66
});
77

8-
[7, 10, 1].forEach(x => {
8+
[7, 10, 1].forEach((x) => {
99
console.log(x);
1010
});
1111

12-
[7, 10, 1].forEach(x => console.log(x));
12+
[7, 10, 1].forEach((x) => console.log(x));
1313

14-
const log = x => console.log(x);
14+
const log = (x) => console.log(x);
1515

1616
[7, 10, 1].forEach(log);

JavaScript/a-map.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ const log = (s, i) => {
55
return s;
66
};
77

8-
const f1 = x => x * 2;
9-
const f2 = x => ++x;
8+
const f1 = (x) => x * 2;
9+
const f2 = (x) => ++x;
1010

11-
const compose = (...funcs) => x => funcs.reduce((v, f) => f(v), x);
11+
const compose = (...funcs) => (x) => funcs.reduce((v, f) => f(v), x);
1212

1313
const f3 = compose(f1, f2);
1414

1515
const res1 = [7, 10, 1, 5, 2]
16-
.filter(x => x > 4)
16+
.filter((x) => x > 4)
1717
.map(f3)
1818
.reduce((acc, val) => acc + val);
1919

@@ -22,7 +22,7 @@ console.log();
2222

2323
[7, 10, 1, 5, 2]
2424
.map(log)
25-
.map(x => x * 2)
25+
.map((x) => x * 2)
2626
.map(log)
27-
.map(x => ++x)
27+
.map((x) => ++x)
2828
.map(log);

JavaScript/b-matrix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const matrix = [
1010
const max = (a, b) => (a > b ? a : b);
1111

1212
const res = matrix
13-
.map(row => row.reduce(max))
13+
.map((row) => row.reduce(max))
1414
.reduce((acc, rowMax) => acc + rowMax);
1515

1616
console.log(res);

0 commit comments

Comments
 (0)