Skip to content

Commit 71ce9bd

Browse files
committed
Sets and data structure
1 parent ee0f28f commit 71ce9bd

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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 testSet = Object.create(null);
28+
testSet.id = 0;
29+
testSet[10] = "Hello World";
30+
if (testSet.id) {
31+
console.log("Its There");
32+
} else {
33+
console.log("Not There");
34+
}
35+
console.log(testSet['10']);
36+
let a = null;
37+
let b = null;
38+
39+
testSet[a] = "Whatever";
40+
console.log(testSet[b]);
41+
let testSet2 = new Set();
42+
43+
testSet2.add("Hello World 1")
44+
testSet2.add("Hello World 2")
45+
46+
// testSet2.delete("Hello World");
47+
48+
testSet2.forEach(function (value, key) {
49+
console.log(key + " " + value);
50+
})
51+
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];
52+
console.log(myArr);
53+
54+
function removeDup(a) {
55+
return [...new Set(a)];
56+
}
57+
58+
console.log(testSet2);
59+
console.log(removeDup(myArr));
60+
</script>
61+
62+
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
63+
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous">
64+
</script>
65+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
66+
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous">
67+
</script>
68+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
69+
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous">
70+
</script>
71+
</body>
72+
73+
</html>

0 commit comments

Comments
 (0)