-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01_useArrayForDataCollection.js
More file actions
45 lines (39 loc) · 938 Bytes
/
01_useArrayForDataCollection.js
File metadata and controls
45 lines (39 loc) · 938 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Use an Array to Store a Collection of Data
/* An array data structure can be one or multi-dimensional.
It can also contain a mixture of data types. */
let simpleArray = ['one', 2, 'three', true, false, undefined, null];
console.log(simpleArray.length); // 7
let complexArray = [
[
{
one: 1,
two: 2
},
{
three: 3,
four: 4
}
],
[
{
a: "a",
b: "b"
},
{
c: "c",
d: "d"
}
]
];
console.log(complexArray.length); // 2
/* We have defined a variable called yourArray. Complete
the statements by assigning an array of at least 5 elements
in length to the yourArray variable. Your array should
contain at least one string, one number and one booean. */
let yourArray = [ // Change this line
"one string",
1,
true,
false,
5
];