If I make an object like this:
var myObj = {
key1: "foo",
key2: "bar",
key3: function() { return "Hi."; }
};
I can access those properties like this:
var myKey = myObj.key1; // assigns myKey the value "foo"
var myFunction = myObj.key3 // assigns myFunction the function function() { return "Hi."; }
Or like this:
var myKey = myObj["key1"]; // assigns myKey the value "foo"
var myFunction = myObj["key3"] // assigns myFunction the function function() { return "Hi."; }
These two styles are logically equivalent. However, the dot notation is preferred according to most JS nerds.
I think the second style can, in some situations, be more convenient or clearer about what the code is doing. But your mileage may vary.