|
|
|
|
|
by cogman10
1845 days ago
|
|
Because in most other languages, an array is an enumeration of values. That's it. In Javascript, arrays are actually dictionaries. But not full dictionaries, rather just dictionaries that can have either a string or numeric key. It's messy because an array in javascript isn't just "an array" it's this mismesh of features that are unexpected to a new-to-javascript developer. Unexpected is the enemy of readable code. |
|
c.f. https://tc39.es/ecma262/#sec-array-exotic-objects