diff --git a/01_Day_JavaScript_Refresher/main.js b/01_Day_JavaScript_Refresher/main.js index bfd08ba..072da7b 100644 --- a/01_Day_JavaScript_Refresher/main.js +++ b/01_Day_JavaScript_Refresher/main.js @@ -33,7 +33,20 @@ const backEnd = ['Node', 'Express', 'MongoDB'] const fullStack = frontEnd.concat(backEnd) -console.log(fullStack) +console.log(fullStack); +const ages = [ 19, 22, 19, 24, 20, 25, 26, 24, 25, 24 ] +const sortedAges = ages.sort((a,b) => a - b ); +console.log(sortedAges[ 0 ],sortedAges[sortedAges.length - 1],(sortedAges[ 0 ] + sortedAges[sortedAges.length - 1 ] )/ 2 ) +console.log(countries.slice( 0, 10 )) + +countries.length % 2 === 0 ? + countries.slice( 0,countries.length / 2 ) + : + countries.push('Turkey') + countries.slice( 0,countries.length / 2 ) + + +console.log(countries.slice( 0,6 ),countries.slice( 6,12 ));