Skip to content

Commit d234700

Browse files
committed
Revert "part6"
This reverts commit 3d006f0.
1 parent 02d3a5d commit d234700

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

arrays/exercises/part-six-arrays.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
//Arrays can hold different data types, even other arrays! A multi-dimensional array is one with entries that are themselves arrays.
22

33
//1) Define and initialize the arrays specified in the exercise to hold the name, chemical symbol and mass for different elements.
4-
let element1 = ['hydrogen', 'H', 1.008]
5-
let element2 = ['helium', 'He', 4.003]
6-
let element26 = ['iron', 'Fe', 55.85]
4+
75
//2) Define the array 'table', and use 'push' to add each of the element arrays to it. Print 'table' to see its structure.
8-
let table=[]
9-
table.push(element1);
10-
table.push(element2);
11-
table.push(element26);
12-
console.log(table);
6+
137
//3) Use bracket notation to examine the difference between printing 'table' with one index vs. two indices (table[][]).
14-
console.log(table[1]);
15-
console.log(table[0,1]);
8+
169
//4) Using bracket notation and the table array, print the mass of element1, the name for element 2 and the symbol for element26.
1710

1811
//5) 'table' is an example of a 2-dimensional array. The first “level” contains the element arrays, and the second level holds the name/symbol/mass values. Experiment! Create a 3-dimensional array and print out one entry from each level in the array.

0 commit comments

Comments
 (0)