fixed semicolon

This commit is contained in:
icorvus 2022-01-23 21:17:39 +01:00
parent c09df52d6a
commit de40b279df
6 changed files with 12 additions and 12 deletions

View File

@ -1,8 +1,8 @@
const findTheOldest = function(array) {
return array.reduce((oldest, currentPerson) => {
const oldestAge = getAge(oldest.yearOfBirth, oldest.yearOfDeath)
const currentAge = getAge(currentPerson.yearOfBirth, currentPerson.yearOfDeath)
return oldestAge < currentAge ? currentPerson : oldest
const oldestAge = getAge(oldest.yearOfBirth, oldest.yearOfDeath);
const currentAge = getAge(currentPerson.yearOfBirth, currentPerson.yearOfDeath);
return oldestAge < currentAge ? currentPerson : oldest;
})
};

View File

@ -1,5 +1,5 @@
const helloWorld = function() {
return 'Hello, World!'
return 'Hello, World!';
};
module.exports = helloWorld;

View File

@ -1,5 +1,5 @@
const leapYears = function(year) {
return year % 4 === 0 && ( year % 100 !== 0 || year % 400 === 0)
return year % 4 === 0 && ( year % 100 !== 0 || year % 400 === 0);
};
module.exports = leapYears;

View File

@ -1,10 +1,10 @@
const repeatString = function(word, times) {
if (times < 0) return 'ERROR'
let string = ''
if (times < 0) return 'ERROR';
let string = '';
for (let i = 0; i < times; i++) {
string += word
string += word;
}
return string
return string;
};
module.exports = repeatString;

View File

@ -1,5 +1,5 @@
const reverseString = function(string) {
return string.split('').reverse().join('')
return string.split('').reverse().join('');
};
module.exports = reverseString;

View File

@ -1,9 +1,9 @@
const ftoc = function(f) {
return Math.round((f - 32) * (5/9) * 10) / 10
return Math.round((f - 32) * (5/9) * 10) / 10;
};
const ctof = function(c) {
return Math.round(((c * 9/5) + 32) * 10) / 10
return Math.round(((c * 9/5) + 32) * 10) / 10;
};