curriculum/challenges/english/blocks/basic-data-structures/587d7b7e367417b2b2512b20.md
The below is an example of the simplest implementation of an array data structure. This is known as a <dfn>one-dimensional array</dfn>, meaning it only has one level, or that it does not have any other arrays nested within it. Notice it contains <dfn>booleans</dfn>, <dfn>strings</dfn>, and <dfn>numbers</dfn>, among other valid JavaScript data types:
let simpleArray = ['one', 2, 'three', true, false, undefined, null];
console.log(simpleArray.length);
The console.log call displays 7.
All arrays have a length property, which as shown above, can be very easily accessed with the syntax Array.length. A more complex implementation of an array can be seen below. This is known as a <dfn>multi-dimensional array</dfn>, or an array that contains other arrays. Notice that this array also contains JavaScript <dfn>objects</dfn>, which we will examine very closely in our next section, but for now, all you need to know is that arrays are also capable of storing complex objects.
let complexArray = [
[
{
one: 1,
two: 2
},
{
three: 3,
four: 4
}
],
[
{
a: "a",
b: "b"
},
{
c: "c",
d: "d"
}
]
];
We have defined a variable called yourArray. Complete the statement by assigning an array of at least 5 elements in length to the yourArray variable. Your array should contain at least one <dfn>string</dfn>, one <dfn>number</dfn>, and one <dfn>boolean</dfn>.
yourArray should be an array.
assert.strictEqual(Array.isArray(yourArray), true);
yourArray should be at least 5 elements long.
assert.isAtLeast(yourArray.length, 5);
yourArray should contain at least one boolean.
assert(yourArray.filter((el) => typeof el === 'boolean').length >= 1);
yourArray should contain at least one number.
assert(yourArray.filter((el) => typeof el === 'number').length >= 1);
yourArray should contain at least one string.
assert(yourArray.filter((el) => typeof el === 'string').length >= 1);
let yourArray; // Change this line
let yourArray = ['a string', 100, true, ['one', 2], 'another string'];