-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
79 lines (57 loc) · 1.57 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//1
for (i=0; i<=10; i++)
{if (i<=0) {console.log(true);} else {console.log(false);};}
//2
let text7 ="";
for (let i=1; i<=10; i++){console.log(`${i} * 7 = ${i * 7}`);
}{
text7 += + "your dog age in human age";
};
//3
function sum(z,x){
return sum = 365 * z * x;}
console.log(sum(25,2));
//4
const month = ["january", "febraury", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
let text8 = "";
for (let i=0; i < month.length; i++){ for(let j=1; j<=12; j++) {
text8 += j + " ";}
};
console.log(text8);
//5
const str = ("hi my name is ahmed", "i")
{let stra = str.split("");
let count = 0;
for (let i = 0; i < stra.length; i++) {
if (stra[i] == i)
{count++;}
}
return count;}
console.log("count");
//6
const chr =["T"];
let text3 = "";
for (let i = 0; i < chr.length; i++){for(j=0; j<=4; j++){text3 += i + " ";}};
const char =["*"];
let text4 = "";
for (let i = 0; i < char.length; i++){for(j=0; j<=4; j++){text4 += i + " ";}}
const charc =["T"];
let text5 = "";
for (let i = 0; i < charc.length; i++){for(j=0; j<=4; j++){text5 += j + " ";}}
//7
let text1 ="";
for (let i = 0; i <= 5; i++){
for (let j = 1; j <= i; j++){text1 += j + " ";}}
let text2 ="";
for (let i = 0; i <= 5; i++){
for (let j = 1; j <= i; j++){text2 += i + " ";}}
//8
const product = ["egg", "milk", "rice", "oranges", "bananas"];
let text6 = "";
for( let i=0; i< product.length; i++){
if (product[i].includes) {console.log(true);
} else {console.log(false);{
text6 += product[i] + " ";
}
};
};