diff --git a/Week1/arrays.js b/Week1/arrays.js index 1e986ad1a..124d0780e 100644 --- a/Week1/arrays.js +++ b/Week1/arrays.js @@ -1,8 +1,8 @@ //append arrays let arraysInside = []; -console.log ('my array will contain: eagle, horse and dog'); +console.log ('my array will contain some animals'); console.log(arraysInside); let myFavoriteAnimals = ['eagle ', 'dog ', 'horse ']; console.log(myFavoriteAnimals); -arraysInside = ['baby pig ' , myFavoriteAnimals]; -console.log(arraysInside); +myFavoriteAnimals.push('baby pig'); +console.log(myFavoriteAnimals); diff --git a/Week1/checkType.js b/Week1/checkType.js index e48f81b1c..ba723023c 100644 --- a/Week1/checkType.js +++ b/Week1/checkType.js @@ -23,26 +23,63 @@ if(typeof myName === typeof myAge){ console.log('NOT SAME TYPE') } +if(typeof myName === typeof myHobbies){ + console.log('SAME TYPE') +} else{ + console.log('NOT SAME TYPE') +} + +if(typeof myName === typeof iAmFunny){ + console.log('SAME TYPE') +} else{ + console.log('NOT SAME TYPE') +} + +if(typeof myName === typeof myAge){ + console.log('SAME TYPE') +} else{ + console.log('NOT SAME TYPE') +} + +if(typeof myName === typeof amIFunny){ + console.log('SAME TYPE') +} else{ + console.log('NOT SAME TYPE') +} + if(typeof myAge === typeof myHobbies){ console.log('SAME TYPE') } else{ console.log('NOT SAME TYPE') } +if(typeof myAge === typeof iAmFunny){ + console.log('SAME TYPE') +} else{ + console.log('NOT SAME TYPE') +} + +if(typeof myAge === typeof amIFunny){ + console.log('SAME TYPE') +} else{ + console.log('NOT SAME TYPE') +} + if(typeof myHobbies === typeof iAmFunny){ console.log('SAME TYPE') } else{ console.log('NOT SAME TYPE') } -if(typeof iAmFunny === typeof amIFunny){ +if(typeof myHobbies === typeof amIFunny){ console.log('SAME TYPE') } else{ console.log('NOT SAME TYPE') } -if(typeof amIFunny === typeof myName){ +if(typeof iAmFunny === typeof amIFunny){ console.log('SAME TYPE') } else{ console.log('NOT SAME TYPE') -} \ No newline at end of file +} + diff --git a/Week1/compairingInfinities.js b/Week1/compairingInfinities.js index 9f837adad..34d90f66d 100644 --- a/Week1/compairingInfinities.js +++ b/Week1/compairingInfinities.js @@ -1,13 +1,19 @@ // store diffrent types of data in one array, and compare the infinitives -let allTypesInsideArray = ['abdullah ', 33 , true] +let allTypesInsideArray = ['abdullah ', 33 , true]; console.log(allTypesInsideArray); console.log('2 examples for compairing infinities') -if(6/0 === 10/0){ +let infinitive1 = 6/0; +let infinitive2 = 10/0; +if(infinitive1 === infinitive2){ console.log(true); } else{ console.log(false); } -console.log(6/0 == 10/0); \ No newline at end of file +console.log(infinitive1 == infinitive2); + +/*in exercise of infinitives i used == and === both +because in this case i wanted to see each option. +i guess types are same but i just anted to see */ diff --git a/Week1/helloInDifLang.js b/Week1/helloInDifLang.js index 0fd6845fb..791046e23 100644 --- a/Week1/helloInDifLang.js +++ b/Week1/helloInDifLang.js @@ -1 +1,3 @@ -console.log ('hello world ' + '\nздравствуйте мира ' + '\nmerhaba dunya'); \ No newline at end of file +console.log ('hello world'); //english +console.log ('здравствуйте мира'); //russian +console.log('merhaba dunya'); //turkish diff --git a/Week1/numberRounding.js b/Week1/numberRounding.js index 64ff9b078..a32c6fdb1 100644 --- a/Week1/numberRounding.js +++ b/Week1/numberRounding.js @@ -4,7 +4,12 @@ console.log(z); let a = Math.round(z); console.log(a); let numbers = [a, z]; -numbers.sort(function(a, b) { return b - a; }); +let highNumber=(Math.max(z,a)); +console.log(highNumber); + +/* ----this is what i found first--- +numbers.sort(function(a, b) { return b - a; }); var highest = numbers[0]; -console.log(highest); +console.log(highest); +*/ diff --git a/Week1/varXInteger.js b/Week1/varXInteger.js index dfb847fb6..cbc72f7c5 100644 --- a/Week1/varXInteger.js +++ b/Week1/varXInteger.js @@ -1,7 +1,7 @@ //giving an integer value to variable x let x; -console.log("the value of my variable x will be: my favorite number"); +console.log("the value of my variable x will be: 775"); console.log(x); x = 775; -console.log("the value of x will be my favorite number: 775"); -console.log(x); \ No newline at end of file +console.log("the value of x will be: 775"); +console.log(x);