-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrayMethodsJS.html
More file actions
24 lines (23 loc) · 880 Bytes
/
arrayMethodsJS.html
File metadata and controls
24 lines (23 loc) · 880 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Array Methods</title>
</head>
<body>
<h1>Array Methods JS</h1>
<h3 id="colors">Colors Array toString</h3>
<h2>tdest12</h2>
<button onclick="showColors()">toString</button><br>
<button onclick="toJoin()">join</button><br>
<button onclick="toPop()">Pop</button><br>
<button onclick="toPush()">Push</button><br>
<button onclick="toShift()">Shift</button><br>
<button onclick="toUnShift()">UnShift</button><br>
<h2>Use shift or pop to delete an item, don't use delete. It creates holes|undefined</h2>
<h2>Concat arrays will return a new array, can concat many</h2>
<h2>splice can be used to add and remove items, returns an array of deleted items</h2>
<h2>slice can be used to create an array starting from an index, does not affect original</h2>
<script src="js/arrayMethods.js"></script>
</body>
</html>