Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 76e28ee

Browse filesBrowse files
committed
Refactor single argument lambdas
1 parent f3a6bab commit 76e28ee
Copy full SHA for 76e28ee

File tree

Expand file treeCollapse file tree

4 files changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+8
-8
lines changed

‎JavaScript/8-event.js

Copy file name to clipboardExpand all lines: JavaScript/8-event.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
const adder = (initial) => {
3+
const adder = initial => {
44
let value = initial;
5-
const add = (delta) => {
5+
const add = delta => {
66
value += delta;
77
if (value >= add.maxValue) add.maxEvent(value);
88
return add;
@@ -17,7 +17,7 @@ const adder = (initial) => {
1717

1818
// Usage
1919

20-
const maxReached = (value) => {
20+
const maxReached = value => {
2121
console.log('max value reached, value: ' + value);
2222
};
2323

‎JavaScript/9-event-emitter.js

Copy file name to clipboardExpand all lines: JavaScript/9-event-emitter.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ const events = require('events');
44

55
const emitter = new events.EventEmitter();
66

7-
emitter.on('new city', (city) => {
7+
emitter.on('new city', city => {
88
console.log('Emitted city: ' + city);
99
});
1010

11-
emitter.on('data', (array) => {
11+
emitter.on('data', array => {
1212
console.log(array.reduce((a, b) => a + b));
1313
});
1414

‎JavaScript/a-deferred.js

Copy file name to clipboardExpand all lines: JavaScript/a-deferred.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const conferences = getConferences();
1717

1818
console.log(conferences);
1919

20-
conferences.data((list) => {
20+
conferences.data(list => {
2121
console.log(list);
2222
});
2323

‎JavaScript/b-errors.js

Copy file name to clipboardExpand all lines: JavaScript/b-errors.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// Implementation
44

5-
const adder = (value) => {
6-
const add = (a) => {
5+
const adder = value => {
6+
const add = a => {
77
value += a;
88
if (value >= add.maxValue) {
99
setImmediate(() => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.