Skip to content

Commit 90728b6

Browse files
committed
Improve examples, remove return
PR-URL: #11
1 parent c4df703 commit 90728b6

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

JavaScript/5-default.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function fnNew(a, b = 'Hello', c = 5) {
99
fnNew(1, 2, 3);
1010
fnNew(1, 2);
1111
fnNew(1);
12+
fnNew();
1213

1314
// Old style for default parameter values
1415
//
@@ -21,6 +22,7 @@ function fnOld(a, b, c) {
2122
fnOld(1, 2, 3);
2223
fnOld(1, 2);
2324
fnOld(1);
25+
fnOld();
2426

2527
// Hash style for default parameter values
2628
//

JavaScript/8-method.js

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

3+
const powName = 'pow';
4+
35
const obj1 = {
46
fn1: function inc(a) {
57
return ++a;
@@ -15,7 +17,7 @@ const obj1 = {
1517
},
1618
min: (a, b) => (a < b ? a : b),
1719
dec: a => --a,
18-
['pow'](a, b) {
20+
[powName](a, b) {
1921
return Math.pow(a, b);
2022
}
2123
};

JavaScript/c-comments.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const printLine = (
1515
console.dir({
1616
fileName, lineNumber, line
1717
});
18-
return true;
1918
};
2019

2120
printLine('./c-comments.js', 5);

0 commit comments

Comments
 (0)