JavaScript “arrays” are a very strange animal. I know ten different programming languages and in all of them, arrays share a common behaviour and structure. JavaScript is the unique exception. I sort of understand what Brendan Eich had in mind when he created the Array object type. He was probably trying to do something along the lines of Lisp. But he should not have called these things “arrays.” They are not arrays in the conventional sense that most programmers understand. It’s bloody confusing.

It’s more disturbing that JavaScript doesn’t have real arrays. What kind of programming language doesn’t have real arrays??? There are all kinds of algorithms that depend on the conventional definition of arrays, and JavaScript throws all this out the window.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store