-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlec3.html
More file actions
116 lines (89 loc) · 2.36 KB
/
lec3.html
File metadata and controls
116 lines (89 loc) · 2.36 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
// function sum1(a=2,b=3){
// console.log(a+b);
// }
// sum1(5,789)
// function sum(a=3){
// if(a%2==0){
// console.log("even");
// }
// else{
// console.log("odd");
// }}
// sum()
// let show=(a)=>{
// console.log(a);
// }
// show(2)
// let arr=[1,2,3,4,5,5]
// for(let i=arr.length;i>=0;i++){
// console.log(arr[i]);
// }
// let arr=[1,2,3,4,5,5]
// let arr1=[]
// for(let i=0;i<arr.length;i++){
// if(arr[i]>3){
// arr1.push(arr[i])
// }
// let arr=[1,2,3,4,5,5]
// let large=arr[0]
// for(let i=0;i<arr.length;i++){
// if(arr[i]>large){
// large=arr[i]
// }
// }
// console.log(large);
// let arr=[1,2,3,4,5,5]
// let count=0
// function sum(data){
// for(let i of data){
// count=count+i;
// }
// console.log(count);
// }
// sum(arr)
// let arr=[{id:1,name:"rahul"},{id:2,name:"rohit"}]
// for(let i of arr){
// console.log(i.name);
// }
// let obj={
// id:1,
// name:"rahul",
// lastName:"jain",
// fullName:function(){
// console.log(obj.name+" "+obj.lastName);
// }
// }
// obj.fullName()
// let arr=[1,2,3,4,5,6,7]
// arr.push(100)
// console.log(arr);
// arr.pop()
// console.log(arr);
// arr.unshift(10)
// console.log(arr);
// arr.shift()
// console.log(arr);
let arr=[1,2,3,4,5]
let target=3
let data= arr.find((a)=>{
return a==3
})
console.log(data);
function sum(){
return 5
console.log("hiiii");
}
// sum()
console.log(sum());
</script>
</body>
</html>