Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Week1/arrays.js
Original file line number Diff line number Diff line change
@@ -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);
43 changes: 40 additions & 3 deletions Week1/checkType.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}

12 changes: 9 additions & 3 deletions Week1/compairingInfinities.js
Original file line number Diff line number Diff line change
@@ -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);
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 */
4 changes: 3 additions & 1 deletion Week1/helloInDifLang.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
console.log ('hello world ' + '\nздравствуйте мира ' + '\nmerhaba dunya');
console.log ('hello world'); //english
console.log ('здравствуйте мира'); //russian
console.log('merhaba dunya'); //turkish
9 changes: 7 additions & 2 deletions Week1/numberRounding.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
*/
6 changes: 3 additions & 3 deletions Week1/varXInteger.js
Original file line number Diff line number Diff line change
@@ -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);
console.log("the value of x will be: 775");
console.log(x);