Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71d8f94

Browse files
author
zohir rayhan
committed
Add of all the exercices of the homework
1 parent 3fb5718 commit 71d8f94

File tree

8 files changed

+85
-0
lines changed

8 files changed

+85
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict'
2+
let numbersTable=[];
3+
console.log("I create an empty table");
4+
numbersTable=[1, 3, 5, 7, 9];
5+
console.log("Numbers table:");
6+
let x; let i=0;
7+
for (x of numbersTable) {
8+
console.log(numbersTable[i]); i++;
9+
}
10+
let animalsTable=["Lion", "Cat", "Dogg"];
11+
console.log("\nAnimals table 1:");
12+
i=0;
13+
for (x of animalsTable) {
14+
console.log(animalsTable[i]); i++;
15+
}
16+
animalsTable.push("Porcelet");
17+
console.log("\nAnimals table 2:");
18+
i=0;
19+
for (x of animalsTable) {
20+
console.log(animalsTable[i]); i++;
21+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
let z=7.25;
3+
console.log("Declaration and initialisation the variable z: "+z);
4+
let a=parseInt(z);
5+
console.log("Declaration and initialisation the variable a: "+a);
6+
let max=(z>a ? z : a);
7+
console.log("The greatest value: "+max);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict'
2+
const array1 = [ "hello" , 123 , true , { name : "Noer" } ] , array2=["balde", "diallo", "sow", "barry"];
3+
console . log ( "the length of the table 1 is: " +array1.length +", the length of the table 2 is: "+array1.length) ;
4+
if(array1.length==array2.length){
5+
console.log("They are the same!");
6+
}else{ console.log("Two different sizes");}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict'
2+
let mySentence="La programmation est tellement intéressante!";
3+
console.log("the lengh of my sentence is: "+mySentence.length);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict'
2+
let x=7, y= 21, z=13;
3+
x = x % 3; y = y % 4; z = z % 2;
4+
console.log("the remainde of x/3 is: "+x);
5+
console.log("the remainde of y/4 is: "+y);
6+
console.log("the remainde of z/2 is: "+z);
7+
8+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
let myNum;
3+
console.log("Variable declaration");
4+
console.log("variable initialisation");
5+
myNum=19;
6+
console.log("the variable type is :"+typeof(myNum));
7+
console.log("the variable value is :"+myNum);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
let myString="Boubacar Balde";
3+
console.log("The variable is a string and containt my name");
4+
console.log("the variable value is :"+myString);
5+
myString="My new string sentence";
6+
console.log("The variable containt a new string");
7+
console.log("the variable value is :"+myString);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
'use strict'
2+
let vari1="First variable", vari2="Second variable", vari3=null, vari4=null;
3+
console.log("the variable 1 type is: "+typeof(vari1)+" the variable 2 type is : "+typeof(vari2));
4+
if(typeof(vari1)===typeof(vari2)){
5+
console.log('SAME TYPE');
6+
}else{console.log('NOT SAME TYPE');}
7+
console.log("the variable 1 type is: "+typeof(vari1)+" the variable 3 type is : "+typeof(vari3));
8+
if(typeof(vari1)===typeof(vari3)){
9+
console.log('SAME TYPE');
10+
}else{console.log('NOT SAME TYPE');}
11+
console.log("the variable 1 type is: "+typeof(vari1)+" the variable 4 type is : "+typeof(vari4));
12+
if(typeof(vari1)===typeof(vari4)){
13+
console.log('SAME TYPE');
14+
}else{console.log('NOT SAME TYPE');}
15+
console.log("the variable 2 type is: "+typeof(vari2)+" the variable 3 type is : "+typeof(vari3));
16+
if(typeof(vari2)===typeof(vari3)){
17+
console.log('SAME TYPE');
18+
}else{console.log('NOT SAME TYPE');}
19+
console.log("the variable 2 type is: "+typeof(vari2)+" the variable 4 type is : "+typeof(vari4));
20+
if(typeof(vari2)===typeof(vari4)){
21+
console.log('SAME TYPE');
22+
}else{console.log('NOT SAME TYPE');}
23+
console.log("the variable 3 type is: "+typeof(vari3)+" the variable 4 type is : "+typeof(vari4));
24+
if(typeof(vari3)===typeof(vari4)){
25+
console.log('SAME TYPE');
26+
}else{console.log('NOT SAME TYPE');}

0 commit comments

Comments
 (0)