-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
216 lines (215 loc) · 7.32 KB
/
Copy pathindex.html
File metadata and controls
216 lines (215 loc) · 7.32 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JavaScript Methods Cheat Sheet</title>
<link rel="stylesheet" href="./css/styles.css" />
<script
src="https://kit.fontawesome.com/b0201ea9e5.js"
crossorigin="anonymous"
></script>
<script src="./scripts/scripts.js" defer></script>
</head>
<body>
<div class="sidebar">
<div class="top">
<div class="logo">
<img src="./images/Me.jpg" alt="Amber">
<span class="sidebarTitle">Methods Practice</span>
</div>
<i class="fa-solid fa-bars" id="btn"></i>
</div>
<ul>
<li>
<a href="./pages/instructions.html"
><i class="fa-solid fa-circle-info"></i>
<span class="nav-item">Instructions</span>
</a>
<span class="tooltip">Instructions</span>
</li>
<li>
<a href="/"
><i class="fa-solid fa-house"></i>
<span class="nav-item">Home Page</span>
</a>
<span class="tooltip">Home Page</span>
</li>
<li>
<a href="./pages/array.html"
><i class="fa-solid fa-1"></i>
<span class="nav-item">Array Methods</span>
</a>
<span class="tooltip">Array Methods</span>
</li>
<li>
<a href="./pages/date.html"
><i class="fa-solid fa-2"></i>
<span class="nav-item">Date Methods</span>
</a>
<span class="tooltip">Date Methods</span>
</li>
<li>
<a href="./pages/map.html"
><i class="fa-solid fa-3"></i>
<span class="nav-item">Map Methods</span>
</a>
<span class="tooltip">Map Methods</span>
</li>
<li>
<a href="./pages/math.html"
><i class="fa-solid fa-4"></i>
<span class="nav-item">Math Methods</span>
</a>
<span class="tooltip">Math Methods</span>
</li>
<li>
<a href="./pages/number.html"
><i class="fa-solid fa-5"></i>
<span class="nav-item">Number Methods</span>
</a>
<span class="tooltip">Number Methods</span>
</li>
<li>
<a href="./pages/object.html"
><i class="fa-solid fa-6"></i>
<span class="nav-item">Object Methods</span>
</a>
<span class="tooltip">Object Methods</span>
</li>
<li>
<a href="./pages/set.html"
><i class="fa-solid fa-7"></i>
<span class="nav-item">Set Methods</span>
</a>
<span class="tooltip">Set Methods</span>
</li>
<li>
<a href="./pages/string.html"
><i class="fa-solid fa-8"></i>
<span class="nav-item">String Methods</span>
</a>
<span class="tooltip">String Methods</span>
</li>
</ul>
</div>
<div class="main">
<h1 class="main-header">Array Methods & Object Methods</h1>
<div class="wrapper">
<div class="array-container">
<h2 class="array-header">
<a href="https://www.w3schools.com/js/js_arrays.asp" target="_blank"
>What is an Array?</a
>
</h2>
<p class="array-definition">
An Array is an object type designed for storing data collections.
</p>
<p class="list-heading">
Key characteristics of JavaScript arrays are:
</p>
<ul class="array-list">
<li>
<strong><em>Elements:</em></strong> An array is a list of values,
known as elements.
</li>
<li>
<strong><em>Ordered:</em></strong> Array elements are ordered
based on their index.
</li>
<li>
<strong><em>Zero indexed:</em></strong> The first element is at
index 0, the second at index 1, and so on.
</li>
<li>
<strong><em>Dynamic size:</em></strong> Arrays can grow or shrink
as elements are added or removed.
</li>
<li>
<strong><em>Heterogeneous:</em></strong> Arrays can store elements
of different data types (numbers, strings, objects and other
arrays).
</li>
<li>
<strong><em>Further documentation: </em></strong
><a
class="documentation"
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array"
target="_blank"
>MDN Arrays</a
>
</li>
</ul>
<h2>Creating an Array:</h2>
<p class="array-definition">
Arrays are created using the const or let keyword a variable name
and [];
</p>
<p class="array-definition">const numbers = [1, 2, 3, 4, 5];</p>
<p class="array-definition">let number = [6, 7, 8, 9, 10];</p>
</div>
<div class="object-container">
<h3 class="object-header">
<a
href="https://www.w3schools.com/js/js_object_property.asp"
target="_blank"
>What is an Object?</a
>
</h3>
<p class="object-definition">
An object is a variable that contains many variables.
</p>
<p class="list-heading">
Key characteristics of JavaScript Objects are:
</p>
<ul class="object-list">
<li>
<strong><em>Real-life objects:</em></strong> Objects represent
real-life objects.
</li>
<li>
<strong><em>Variables:</em></strong> Objects are defined like a
variable.
</li>
<li>
<strong><em>Key : Value pairs:</em></strong> Objects are created
using key : value pairs.
</li>
<li>
<strong><em>Keys:</em></strong> Keys are the assigned properties
of an object.
</li>
<li>
<strong><em>Values:</em></strong> Values are the assigned data
associated with the property.
</li>
<li>
<strong><em>Further documentation: </em></strong><a
class="documentation"
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object"
target="_blank"
>MDN Objects</a
>
</li>
</ul>
<h2>Creating an Object:</h2>
<p class="object-definition">
Objects are created using the const or let keyword a variable name =
{};
</p>
<p class="object-definition">
const car = {name: "Ford", make: "Escort", year: 1989, mileage:
123,456,};
</p>
<p class="object-definition">
let car = {name: "Plymouth", make: "Duster", year: 1973, mileage:
178,431,}; "
</p>
</div>
</div>
<h1 class="purpose">
Let's sharpen your memory of methods by matching the methods!
</h1>
</div>
</body>
</html>