We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52b8fdc commit 783f7a0Copy full SHA for 783f7a0
Arrays
@@ -0,0 +1,29 @@
1
+// [Arrays] //
2
+
3
+let example1 = [5, 5, 6];
4
+console.log(example1.length); // 3
5
6
7
+let example1 = [5, 7, 6];
8
9
+console.log(example1[0]); // 5
10
+// similar to python where the list starts at 0
11
12
13
14
15
16
+example1.push(8, 9, 10); // adds element
17
+example1.pop(); // pops out element
18
+console.log(example1[0]);
19
20
21
+example1[0] = 1; // replaces the first element (overwrite)
22
23
+// say want to iterate across the array
24
25
+example1.forEach((element)) => {
26
+ console.lof(element)
27
+}); // this is similar syntax for python for loop
28
29
0 commit comments