-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoops.js
More file actions
57 lines (48 loc) 路 1.19 KB
/
Copy pathLoops.js
File metadata and controls
57 lines (48 loc) 路 1.19 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
//For-of interater
// let str="RajaKumarSaniya";
// for(let i of str){
// console.log("i=",i);
// }
//Length
// let str="RajaKumarSaniya";
// let size=0;
// for(let i of str){
// console.log("i=",i);
// size++;
// }
// console.log("Size=",size);
//->for in iterator
/* let student={
Name:"RajaKumar",
age:20,
cgpa:8.5,
ispass:true
};
//key printing
for(let key in student){
console.log("key=",key);
}
//key-> values printing
for(let val in student){
console.log("val=",student[val]);
} */
/* question : 1->100 counting printing / Even number /odd number
for(let i=0;i<=100;i++){
console.log("i=",i);
}
Even Number
for(let i=0;i<100;i++){
if(i%2==0){
console.log("Even number=",i);
}else{
console.log("Odd number=",i);
}
}
*/
//Question 2 : Guess Number Game
/* let GameNumber = 25;
let userNum = Number(prompt("Guess the Number:"));
while (userNum !== GameNumber) {
userNum = Number(prompt("Wrong guess 馃槄 Try again:"));
}
console.log("馃帀 Congratulations Raj! You guessed the correct number."); */