-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment
More file actions
31 lines (25 loc) · 777 Bytes
/
Assignment
File metadata and controls
31 lines (25 loc) · 777 Bytes
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
/* Program to find perticular character*/
var a="swaroopa"
var b=a.charAt(0);
console.log(b);
/*Program to convert minutes to seconds*/
var a=prompt("enter the minute value");
var b=a*60;
console.log("The convertes minute into second is" + b );
/*program to find perticular element in array of string*/
var a=["swaroopa", "niroopa", "laxmi", "sangeeta"];
var b=a.indexOf("swaroopa");
console.log(b);
/*program to display element which contains only 'a' in them from an array*/
var a=["swaroopa", "niroopa", "zzz"];
for(var i=0; i<a.length; i++){
var b=a[i];
for(var j=0; j<b.length; j++){
if(b[j]=='a'){
console.log(b);
}
}
}
/*program to reverse the array*/
var a=["swaroopa", "niroopa", "zzz"];
console.log(a.reverse());