re: When is an array, not an array? VIEW POST

re: Thanks Joe for the post. Is an "array data structure" a superset of "array type"? or are they not related at all?

Types refer to the language implimentations, basically it's whatever looks like an array and
a specific language says is an array.

The data structure definition is more formal: contiguos memory allocation of the same sized element so you can achieve random access (as in, lookup any) in constant time.

In some languages, array types are implimented with array data structures (like C#) but JavaScript is a bit more complicated because it has to support a flexible language specification.


Borrowing C# analogy,

Types refer to an interface while data structure is a type of implementation implementing the interface.

Am I getting close to the truthiness? 😆

Code of Conduct Report abuse