📌 Arrays use numbered indexes. Objects use named indexes.
Arrays can be mutable too because arrays are kind of objects at the end.
When to Use Arrays
You should use arrays when you want the element names to be numbers.
That means, you would want to use arrays when order is the most important factor to organize your data.
When to Use Objects
You should use objects when you want the element names to be strings (text).
Which means, when you care about the label more than indexes, use objects. Making it a nice key value pair.
array class Data Types difference Immutable Mutability objects