Skip to content

Commit 7df108c

Browse files
authored
Merge pull request TheOdinProject#216 from icorvus/solutions
2 parents 8150be9 + de40b27 commit 7df108c

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

findTheOldest/findTheOldest.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const findTheOldest = function(array) {
22
return array.reduce((oldest, currentPerson) => {
3-
const oldestAge = getAge(oldest.yearOfBirth, oldest.yearOfDeath)
4-
const currentAge = getAge(currentPerson.yearOfBirth, currentPerson.yearOfDeath)
5-
return oldestAge < currentAge ? currentPerson : oldest
3+
const oldestAge = getAge(oldest.yearOfBirth, oldest.yearOfDeath);
4+
const currentAge = getAge(currentPerson.yearOfBirth, currentPerson.yearOfDeath);
5+
return oldestAge < currentAge ? currentPerson : oldest;
66
})
77
};
88

getTheTitles/getTheTitles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const getTheTitles = function(array) {
2-
return array.map(book => book.title)
2+
return array.map(book => book.title);
33
};
44

55
module.exports = getTheTitles;

helloWorld/helloWorld.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const helloWorld = function() {
2-
return 'Hello, World!'
2+
return 'Hello, World!';
33
};
44

55
module.exports = helloWorld;

leapYears/leapYears.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const leapYears = function(year) {
2-
return year % 4 === 0 && ( year % 100 !== 0 || year % 400 === 0)
2+
return year % 4 === 0 && ( year % 100 !== 0 || year % 400 === 0);
33
};
44

55
module.exports = leapYears;

repeatString/repeatString.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const repeatString = function(word, times) {
2-
if (times < 0) return 'ERROR'
3-
let string = ''
2+
if (times < 0) return 'ERROR';
3+
let string = '';
44
for (let i = 0; i < times; i++) {
5-
string += word
5+
string += word;
66
}
7-
return string
7+
return string;
88
};
99

1010
module.exports = repeatString;

reverseString/reverseString.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const reverseString = function(string) {
2-
return string.split('').reverse().join('')
2+
return string.split('').reverse().join('');
33
};
44

55
module.exports = reverseString;

tempConversion/tempConversion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const ftoc = function(f) {
2-
return Math.round((f - 32) * (5/9) * 10) / 10
2+
return Math.round((f - 32) * (5/9) * 10) / 10;
33
};
44

55
const ctof = function(c) {
6-
return Math.round(((c * 9/5) + 32) * 10) / 10
6+
return Math.round(((c * 9/5) + 32) * 10) / 10;
77
};
88

99

0 commit comments

Comments
 (0)