Skip to content

Commit ee0f28f

Browse files
committed
Maps
1 parent f9961cc commit ee0f28f

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

New_ECMAScript_6/Maps.html

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>&#x1F3F4;&#x200D;&#x2620;&#xFE0F; Complete Javascripts Course</title>
8+
<!-- Latest compiled and minified CSS -->
9+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
10+
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
11+
<style>
12+
13+
</style>
14+
</head>
15+
16+
<body>
17+
<br />
18+
<br />
19+
<center>
20+
<br />
21+
<div id="wrapper">&#x1F4C3; &#x1F3EA; 👾</div>
22+
<div id="output">Complete JavaScript Course</div>
23+
<br />
24+
<div></div>
25+
</center>
26+
<script>
27+
let myArr = [1, 4, 6, 3, 6, 3, 6, 3, 644, 23, 32, 2, 3, 4, 5, 6, 7, 87, 2, 3, 4, 3, 43, 33];
28+
console.log(myArr);
29+
30+
function removeDup(a) {
31+
return [...new Set(a)];
32+
}
33+
34+
let mapArray = myArr.map(function (a) {
35+
return a *= 10;
36+
})
37+
38+
console.log(mapArray);
39+
40+
let myMap = new Map();
41+
myMap.set("Hello World!");
42+
myMap.set("MyName", "Larence");
43+
console.log(myMap);
44+
myMap.set("MyName", "Larence");
45+
myMap.delete("Hello");
46+
console.log(myMap);
47+
console.log(myMap.size);
48+
console.log(myMap.has("World"));
49+
console.log(myMap.get("World"));
50+
51+
52+
let items = [{
53+
name: 'iPhone',
54+
details: 'White',
55+
cost: 50000
56+
}, {
57+
name: 'iPad',
58+
details: 'White',
59+
cost: 80000
60+
}, {
61+
name: 'Cable',
62+
details: '3 foot',
63+
cost: 1000
64+
}, {
65+
name: 'Camera',
66+
details: '25MP',
67+
cost: 30000
68+
}, {
69+
name: 'Laptop',
70+
details: 'Intel i7',
71+
cost: 120000
72+
}, {
73+
name: 'LCD Monitor',
74+
details: '24 inch',
75+
cost: 20000
76+
}, {
77+
name: 'TV',
78+
details: '50 inch',
79+
cost: 45000
80+
}];
81+
82+
console.log(items);
83+
let holderNames = items.map(items => items.name)
84+
console.log(holderNames);
85+
86+
let holderCosts = items.map(items => items.cost);
87+
console.log(holderCosts);
88+
</script>
89+
90+
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
91+
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous">
92+
</script>
93+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
94+
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous">
95+
</script>
96+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
97+
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous">
98+
</script>
99+
</body>
100+
101+
</html>

0 commit comments

Comments
 (0)