-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
103 lines (85 loc) · 2.13 KB
/
script.js
File metadata and controls
103 lines (85 loc) · 2.13 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
/* function addFive(a,b){
return a + b;
};
expect(addFive(10,16)).toBe(16); */
// let cars = [1,2,3,45,6,7,7,9];
// // cars.forEach((val, idx, arr) =>{
// // console.log(val, idx, arr);
// // });
// let result = cars.reduce((val, idx) =>{
// return val + idx;
// })
// console.log(result);
/* class Person{
constructor(name){
this.name = name;
}
introduce(){
console.log(`Hi my name is ${this.name}`);
}
}
class Student extends Person{
constructor(name, studentId){
super(name);
this.studentId = studentId;
}
study(){
console.log(`Student ${this.name} is studying`);
}
}
const s1 = new Student("Rishiraj","A-67");
s1.introduce();
s1.study(); */
// const btn = document.getElementById('btn');
// btn.style.color = "white";
// btn.style.background = "blue";
// btn.style.display = "flex";
// btn.style.justifyContent = "center";
// btn.style.margin = "20px auto";
// btn.style.padding = "10px 30px";
// btn.style.fontSize = "30px";
// btn.style.boxShadow = "2px 2px 10px black";
// btn.style.border = "none";
// btn.style.borderRadius = "10px";
// btn.style.cursor = "pointer";
// function onLoading(){
// let h3 = document.createElement('h3');
// h3.innerText = "Loading..."
// h3.style.color = "Green";
// h3.style.display = "flex";
// h3.style.justifyContent = "center";
// h3.style.margin = "20px auto";
// h3.style.fontSize = "30px"
// document.body.appendChild(h3);
// }
// btn.addEventListener('click', onLoading);
// function fact(num){
// let fact = 1;
// if(num === 0){
// console.log("1");
// }
// else if(num < 0){
// console.log("not Exist");
// }
// else{
// for(let i = 1; i <= num; i++){
// fact = fact * i;
// }
// console.log(fact);
// }
// }
// fact(5);
// function prime(num) {
// if (num <= 1) {
// console.log("not a prime number.");
// return;
// }
// for (let i = 2; i < num; i++) {
// if (num % 2 == 0) {
// console.log("not a prime number.");
// }
// }
// console.log("is a prime number");
// }
// prime(5);
// prime(1);