-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
217 lines (170 loc) · 3.9 KB
/
Copy pathindex.js
File metadata and controls
217 lines (170 loc) · 3.9 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
//primitive types
//*numbesr
//const age=10
//console.log(age)
/*strings
const name="maxamud"
console.log(name)
//boolean
const playing=true
console.log(playing)
//null.undefined
const count=null;
console.log(null)
//undefined
let car
console.log(car)
//array
const list=["maxamud","maxamed","cabdi"];
let number=[10,80,70,"babuur","diyaarad"]
//unshift() waxaa lo isticmaala marka xarafka horey kaga so dareesid
//push() waxaa lo isticmaala marka xarafka gadaal kaga so dareesoid
//marka listiga lambarka ugu horeeeyo ka saareysid waxaa isticmaaleysaa .shift()
//marka lambarka ugudambeeyoaad rabtit oinaa ka saartit waxaa isticmaaleysaa .pop()
number.pop()
number.shift()
number.unshift (100)
number.push (200)
the sprit operatiot[...]waxaa lo isticmaala marka rabtit waxii hore inaa wax ku dartit oo kopiogareysid
const fruis=['banaana','apple ','tomato','orange']
const newfruis=[...fruis,'salad']
//*object
//object waxaa lo isticmaalaa let{} waxaana marlwabo xasuustaada inaa isticmaashid ,
let info={
schoolName:'aqoonta bar',
computerName:'asu vivibook',
date:(6.22,2022),
studen:{
Names:'maxamud',
id:900990,
from:'somalia',
age:27
},
msn: function(){
console.log("hello");
},
numbers:[10,30,50]
}
//fuctionka (){} shaqadiisa ayaa waxee ee tahay inaa u wacdi wax aad qortay malwabo waxaana loogu waxaa console.log kadib fuctionka magaca u bixisay isticmaal
function neliö(a,b){
return a+b
}
console.log(neliö(100,200))
//fuction scope
//function name(){
// console.log('i.m maxamud maxamed cabdi i like codding')
// const number=10
// console.log(number)
//}
//name();
//if and else statement
//if somthing is tru do somthing
//else do somthing
//let userinput=prompt('wite here only number please')
//if(userinput >=10){
//console.log('that is larg number')
//}
//else if(userinput <=5){
//console.log('that is ok')
//}
//else{
console.log('no')
//}
let number=prompt('write here number please')
if(number==1){
console.log('this number is one')
}
else if(number==2){
console.log('this number is two')
}
else if(number==3){
console.log('this number is three')
}
else if(number==4){
console.log('this number is four')
}
else if(number==5){
console.log('this number is five')
}
else{
console.log('that number is out of the reng')
}
let day= 'monday';
switch (day){
case 'monday':
console.log('today is monday');
break;
case 'tuesday':
console.log('today is tuesday');
break;
default:
console.log('not find')
}
let date=new Date();
let day=date.getDay();
switch(day){
case 1:
console.log('its monday');
break
case 2:
console.log('its tuesday');
break
case 3:
console.log('its wednesday');
break
case 4:
console.log('itsthursday');
break
case 5:
console.log(' its friday');
break;
default:
console.log('its not valid')
}
console.log(day)
//loob while
//for loob.
let count=0;
while(count<10){
console.log(count);
count++;
}
const person='maxamud'
const id=(090090);
const number=(0451333)
const heigh=(175)
const from='somalia'
console.log(typeo)
//how array work
const list=['maxamud','cabdi','somalia','finland']
const list2=['coffe','tea','water','helisnki']
console.log(list[3])
//emple2 for array
//const list={firstName:"maxamud" ,lastName:'cabid',age:27}
//console.log(list.lastName,list.age)
const cars=['toyota','nissan','jugwar','bwn']
console.log(cars[0])
console.log(cars[1])
console.log(cars[2])
console.log(cars[3])
cars.push('ferrari')
cars.push('mazda')
cars.unshift('lambur')
console.log(cars.toString)
function yello(name,lastName){
console.log('hello'+'name' +'', 'lastName')
}
yello('mxamud','cabdi')
//variable tehtävi
//var carName='volvo'
//var x=5
//var y=10
//var z=y+b
//object
const person={
name:'maxamud',
age:34
}
console.log(person.name,person.age)
*/
//events