File tree Expand file tree Collapse file tree 7 files changed +13
-13
lines changed Expand file tree Collapse file tree 7 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 1
1
const findTheOldest = function ( array ) {
2
2
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 ;
6
6
} )
7
7
} ;
8
8
Original file line number Diff line number Diff line change 1
1
const getTheTitles = function ( array ) {
2
- return array . map ( book => book . title )
2
+ return array . map ( book => book . title ) ;
3
3
} ;
4
4
5
5
module . exports = getTheTitles ;
Original file line number Diff line number Diff line change 1
1
const helloWorld = function ( ) {
2
- return 'Hello, World!'
2
+ return 'Hello, World!' ;
3
3
} ;
4
4
5
5
module . exports = helloWorld ;
Original file line number Diff line number Diff line change 1
1
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 ) ;
3
3
} ;
4
4
5
5
module . exports = leapYears ;
Original file line number Diff line number Diff line change 1
1
const repeatString = function ( word , times ) {
2
- if ( times < 0 ) return 'ERROR'
3
- let string = ''
2
+ if ( times < 0 ) return 'ERROR' ;
3
+ let string = '' ;
4
4
for ( let i = 0 ; i < times ; i ++ ) {
5
- string += word
5
+ string += word ;
6
6
}
7
- return string
7
+ return string ;
8
8
} ;
9
9
10
10
module . exports = repeatString ;
Original file line number Diff line number Diff line change 1
1
const reverseString = function ( string ) {
2
- return string . split ( '' ) . reverse ( ) . join ( '' )
2
+ return string . split ( '' ) . reverse ( ) . join ( '' ) ;
3
3
} ;
4
4
5
5
module . exports = reverseString ;
Original file line number Diff line number Diff line change 1
1
const ftoc = function ( f ) {
2
- return Math . round ( ( f - 32 ) * ( 5 / 9 ) * 10 ) / 10
2
+ return Math . round ( ( f - 32 ) * ( 5 / 9 ) * 10 ) / 10 ;
3
3
} ;
4
4
5
5
const ctof = function ( c ) {
6
- return Math . round ( ( ( c * 9 / 5 ) + 32 ) * 10 ) / 10
6
+ return Math . round ( ( ( c * 9 / 5 ) + 32 ) * 10 ) / 10 ;
7
7
} ;
8
8
9
9
You can’t perform that action at this time.
0 commit comments