-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask-10.html
More file actions
40 lines (40 loc) · 1.16 KB
/
Task-10.html
File metadata and controls
40 lines (40 loc) · 1.16 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body><div style="text-align: center;"><h1>Output of Array Methods can be seen in console window</h1></div>
<script>
const a = [10,20,30];
const b = [40,50,60];
const c= a.concat(b);
function func(num)
{
return num/10;
}
function check(num)
{
return num>10
}
console.log("concat method-> "+c);
console.log("copywithin method-> "+c.copyWithin(3,0));
console.log("map method-> "+b.map(func));
console.log("every method-> "+a.every(check));
console.log("some method-> "+a.some(check));
console.log("filter method-> "+a.filter(check));
console.log("find method-> "+a.find(check));
console.log("findIndex method-> "+a.findIndex(check));
console.log("IndexOf method-> "+a.indexOf(30));
console.log("Lastindexof method-> "+c.lastIndexOf(30));
a.push(40);
console.log("Push method-> "+a);
a.pop();
console.log("Pop method-> "+a);
a.shift();
console.log("shift method-> "+a);
</script>
</body>
</html>