Skip to content

Commit 796a9f5

Browse files
arrays
1 parent e6d0844 commit 796a9f5

3 files changed

Lines changed: 80 additions & 68 deletions

File tree

arrays.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// let n=[10,20,30,40,50]
2+
// n.toString()
3+
// console.log(n)
4+
5+
6+
// let s=[250, 645, 300, 900, 50];
7+
// let n=Number(prompt("Enter the item offer in % format : "));
8+
// for (let i=0;i<s.length;i++){
9+
// m=s[i]*n/100;
10+
// s[i]=s[i]-m
11+
// }
12+
// console.log(s)
13+
14+
15+
// let saveetha=["SSE","SSp","SMCH"]
16+
// let vit=["Vit-Ap","Vit-che"]
17+
// let colleges=saveetha.concat(vit)
18+
// console.log(colleges)
19+
20+
// let n=[10,20,30,40,50,60]
21+
// n.splice(2,2,22,33)
22+
// console.log(n)
23+
// n.splice(3,0,70)
24+
// n.splice(3,1)
25+
// console.log(n)
26+
27+
28+
// let c=["Bloomberg","Microsoft","Uber","Google","IBM","Netflix"]
29+
// c.shift();
30+
// console.log(c)
31+
// c.splice(1,1,"ola")
32+
// console.log(c)
33+
// c.push("Amazon")
34+
// console.log(c)
35+
36+
// let n=[10,20,30,40,50,60]
37+
// n.splice(2)
38+
// console.log(n)
39+
40+
// let n=[10,20,30,40,50,60]
41+
// n.splice(2,2,22,33)
42+
// console.log(n)
43+
44+
let n=[10,20,30,40,50,60]
45+
n.splice(2,2,22,33)
46+
console.log(n)
47+
n.splice(3,0,70)
48+
console.log(n)
49+
n.splice(3,1)
50+
console.log(n.length)

new.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>Document</title>
77
</head>
88
<body>
9-
<script src="script.js"></script>
9+
<script src="arrays.js"></script>
1010
</body>
1111

1212
</html>

tempCodeRunnerFile.js

Lines changed: 29 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,38 @@
1-
// const profile={
2-
// username: "shradhakhapar",
3-
// isfollow:true,
4-
// message: "click here for message ",
5-
// posts: 150 ,
6-
// followers: 150,
7-
// description : "Hi i'm an entraprenuer"
8-
// }
9-
// console.log(profile)
10-
11-
12-
// const student={
13-
// fullname : "Ambavaram Tirumala Kondareddy",
14-
// phone : 9392887268 ,
15-
// gender : "Male" ,
16-
// Address : "Akkalareddypalli "
17-
// }
18-
// console.log(student)
1+
// let n=[10,20,30,40,50]
2+
// n.toString()
3+
// console.log(n)
194

20-
// let a = 5;
21-
// let b = 10;
22-
// c= a+b
23-
// d=a-b
24-
// e=a*b
25-
// f=a/b
26-
// console.log("a+b = ",c,d,e,f)
275

28-
29-
//conditinal Statements
30-
31-
// let age=18;
32-
// if (age >18){
33-
// age='he is eligible for vote'
34-
// }else{
35-
// age='he is not eligible to vote'
6+
// let s=[250, 645, 300, 900, 50];
7+
// let n=Number(prompt("Enter the item offer in % format : "));
8+
// for (let i=0;i<s.length;i++){
9+
// m=s[i]*n/100;
10+
// s[i]=s[i]-m
3611
// }
12+
// console.log(s)
3713

38-
// console.log(age)
3914

15+
// let saveetha=["SSE","SSp","SMCH"]
16+
// let vit=["Vit-Ap","Vit-che"]
17+
// let colleges=saveetha.concat(vit)
18+
// console.log(colleges)
4019

41-
// let x=18
42-
// x=x+1
43-
// if (x%2===0){
44-
// x='it is even'
45-
// }else{
46-
// x='it is not even'
47-
// }
48-
// console.log(x)
20+
// let n=[10,20,30,40,50,60]
21+
// n.splice(2,2,22,33)
22+
// console.log(n)
23+
// n.splice(3,0,70)
24+
// n.splice(3,1)
25+
// console.log(n)
4926

50-
// let vote=18;
51-
// if (vote<18){
52-
// vote='he is not eligible to vote'
53-
// }else if(vote>18){
54-
// vote='he is eligible to vote'
55-
// }else{
56-
// vote='he do not have vote to cast'
57-
// }
58-
// console.log(vote)
5927

60-
// let x=1 ;
61-
// x>18 ? console.log("u can vote ") : console.log( "u cannt vote")
28+
// let c=["Bloomberg","Microsoft","Uber","Google","IBM","Netflix"]
29+
// c.shift();
30+
// console.log(c)
31+
// c.splice(1,1,"ola")
32+
// console.log(c)
33+
// c.push("Amazon")
34+
// console.log(c)
6235

63-
//Switch Case
64-
let varac="laddu"
65-
switch(varac){
66-
case 'mangoes':
67-
console.log("Fruits are not matched");
68-
break;
69-
case 'Apples':
70-
console.log("Fruits are matched")
71-
break
72-
case 'Papayas':
73-
console.log("papayas are there");
74-
default:
75-
console.log("No Fruit is matched");
76-
}
36+
let n=[10,20,30,40,50,60]
37+
n.splice(2)
38+
console.log(n)

0 commit comments

Comments
 (0)