Skip to content

Commit 9121415

Browse files
committed
Optimize lower
1 parent 3cfe448 commit 9121415

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

JavaScript/2-composition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const upperCapital = s => s.split(' ')
88
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
99
.join(' ');
1010

11-
const lower = s => (typeof s === 'string' ? s.toLowerCase() : '');
11+
const lower = s => s.toLowerCase();
1212

1313
const s = 'MARCUS AURELIUS';
1414
console.log(s);

JavaScript/3-arguments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const upperCapital = s => s.split(' ')
88
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
99
.join(' ');
1010

11-
const lower = s => (typeof s === 'string' ? s.toLowerCase() : '');
11+
const lower = s => s.toLowerCase();
1212

1313
const s = 'MARCUS AURELIUS';
1414
console.log(s);

JavaScript/4-multiple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const upperCapital = s => s.split(' ')
1010
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
1111
.join(' ');
1212

13-
const lower = s => (typeof s === 'string' ? s.toLowerCase() : '');
13+
const lower = s => s.toLowerCase();
1414

1515
const trim = s => s.trim();
1616

JavaScript/5-loop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const upperCapital = s => s.split(' ')
1616
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
1717
.join(' ');
1818

19-
const lower = s => (typeof s === 'string' ? s.toLowerCase() : '');
19+
const lower = s => s.toLowerCase();
2020

2121
const trim = s => s.trim();
2222

JavaScript/6-recursive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const upperCapital = s => s.split(' ')
1414
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
1515
.join(' ');
1616

17-
const lower = s => (typeof s === 'string' ? s.toLowerCase() : '');
17+
const lower = s => s.toLowerCase();
1818

1919
const trim = s => s.trim();
2020

0 commit comments

Comments
 (0)