Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Silly Javascript. Parent comment
[] 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]
[] 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.