Arrays and objects are not primitives and can contain mixed types. Here are a few examples:
const officers = ['Riker','Data','Worf']
const captain = {
"name": "Jean-Luc Picard",
"age": 62,
"serialNumber": "SP 937-215",
"command": "NCC 1701-D",
"seniorStaff": officers
}
officers is an array, as we can see with the square brackets. One of the interesting facts about arrays is that even though we usually declare them as a const, the values inside the array can be changed. .push() and .pop() are two useful methods for manipulating arrays:
officers.push('Troi') // officers now equals ['Riker','Data','Worf', 'Troi']
Notice that the values in the array are not ordered in any way; we can get Riker by accessing the array with bracket notation: officers[0]. However, if we were to try to completely reassign the array...