Skip to content

Commit 3b1c05d

Browse files
committed
Fix examples
1 parent fb77a4a commit 3b1c05d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

JavaScript/2-sync-tuple.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict';
22

3-
function fn(a, b) {
3+
function sum(a, b) {
44
if (typeof(a) === 'number' && typeof(b) === 'number') {
55
return [null, a + b];
66
} else {
77
return [new Error('a and b should be numbers')];
88
}
99
}
1010

11-
console.log(fn(2, 3));
12-
console.log(fn(7, 'A'));
11+
console.log(sum(2, 3));
12+
console.log(sum(7, 'A'));

JavaScript/3-async.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
'use strict';
22

3-
function fn2(a, b, callback) {
3+
function sum(a, b, callback) {
44
if (typeof(a) === 'number' && typeof(b) === 'number') {
55
callback(null, a + b);
66
} else {
77
callback(new Error('a and b should be numbers'));
88
}
99
}
1010

11-
fn2(2, 3, (err, result) => {
11+
sum(2, 3, (err, result) => {
1212
if (err) {
1313
console.log(err.message);
1414
return;
1515
}
1616
console.log(result);
1717
});
1818

19-
fn2(7, 'A', (err, result) => {
19+
sum(7, 'A', (err, result) => {
2020
if (err) {
2121
console.log(err.message);
2222
return;
File renamed without changes.

0 commit comments

Comments
 (0)