>> Why have [] syntax for "arrays"
[] syntax is for objects and arrays. As I've said, an array is just an object... Same data type.
If you didn't have a [] syntax, you wouldn't be able to use a variable to reference properties on an object.
var baz = "foo";
foo.bar == foo["bar"] == foo[baz]So we're back to my main argument -- minimalism is confusing.
Sure, x.a should stringize 'a' to make property access work cleanly, but why when using the indexing syntax?
For example:
which seems wholly more reasonable.