Advantages


Lightening Fast Indexed Access
Fixed array access is terrifically fast. And, the access time does not increase as the size of the array increases.

This speed is because a fixed array is in contiguous memory. This allows the use of simple arithmetic computations to compute an address location.

Extra info: Low level computing for array access.


Disadvantages


Size is Fixed
The size (number of elements) in the fixed array is fixed.

In other words, we can not add/append, insert or remove elements.


Typical Operations


We'll now look at typical fixed array operations. Most programming languages would support these or something similar.

Initialization
Initialize fixed array
function demoInitialization() {
	let array = [10, 20, 30, 40];
	console.log(array.toString());
	//[10, 20, 30, 40]
}
//Try It
demoInitialization()
Get Fixed Array Length
We can use length to get a count of the number of elements in a fixed array. This is a fast operation -- Big-O O(1).
function demoArrayLength() {
	let array = [10, 20, 30, 40];
	let len = array.length;
	console.log("Length: " + len);
	//prints 4
}
//Try It
demoArrayLength()
Access First Element
The fixed array subscript operator [] is an operator that provides fixed array access (getting and setting).

Typically fixed arrays are zero-based -- i.e., the array starts at index 0.
function demoAccessFirstElement() {
	let array = [10, 20, 30, 40];
	//Fixed array is zero-based (first element is index pos 0)
	console.log("First Element: " + array[0]);
	//prints 10
}
//Try It
demoAccessFirstElement()
Access Third Element
Here we get the third element (index = 2).
function demoAccessThirdElement() {
	let array = [10, 20, 30, 40];
	console.log("Third Element: " + array[2]);
	//prints 30
}
//Try It
demoAccessSecondElement()
Access Last Element
Here we get the last element, which has an index equal to the fixed array length minus one.
function demoAccessLastElement() {
	//Leverage the relationship between length and the last index
	let array = [10, 20, 30, 40];
	console.log("Last Element: " + array[array.length - 1]);
	//prints 40
}
//Try It
demoAccessLastElement()
Set Second Element
Here we set the second element.
function demoSetSecondElement() {
	let array = [10, 20, 30, 40];
	array[1] = 101;
	console.log(array.toString());
	//prints [10, 101, 30, 40]
}
//Try It
demoSetSecondElement()
Iterating Over Elements
Here we iterate (or loop/traverse) through the elements of an array.
function demoElementIteration() {
	//Iterate over elements
	let array = [10, 20, 30, 40];
	for (let nextElement of array) {
		console.log("Next element in iteration: " + nextElement);
	}
}
//Try It
demoElementIteration()
Iterating With Indexes
Here we iterate (or loop/traverse) over all the indexes of an array, and access elements using the current index relative to the iteration.
function demoIndexedIteration() {
	let array = [10, 20, 30, 40];
	for (let nextIndex = 0; nextIndex < array.length; nextIndex++) {
		console.log("Next element in iteration: " + array[nextIndex]);
	}
}
//Try It
demoIndexedIteration()