Array
- They are fixed size, continiguous memory chunks
- That means you cannot grow it
- There is no "insertAt" or push or pop. Doesn't mean you can't write those though
// The memory part, where we define the size
const a = new ArrayBuffer(6)
// the array view
const a8 = new Uint8Array(a)
a8[0] = 45;
a8[2] = 45;
// the array view
const a16 = new Uint16Array(a);
a16[0] = 0x45454;
a16[5] = 0x45454;
console.log(a8)
console.log(a16)
console.log(a8)
In javascript, this is not an array.
const arr = []
- Because it grows.
Array suck, this is why!
- Deletion: You can't delete, but you can zero it.
- Insertion: You can't insert, but you can write it.
- Its ungrowable: It fixed.