Question: ```
var stooge = {
    "first-name": "Jerome",
        "last-name": "Howard"
};
var properties = [
    'first-name',
    'middle-name',
    'last-name',
    'profession'];
for (i = 0; i < properties.length; i++) {
    console.log(properties[i] + ': ' + stooge[properties[i]]);
}

```

I don't understand `stooge[properties[i]]`. Why are we using bracket before properties?
Can someone explain when to use brackets?

Answer: 
> 
> I dont understand stooge[properties[i]].
> 
> 
> 

It means more or less literally what it says.

If `i` is 0, then `properties[i]` is `properties[0]`, which is set to 'first-name'.

Therefore, `stooge[properties[i]]` is `stooge[properties[0]]` is `stooge['first-name']` is "Jerome".

**EDIT**

As someone pointed out, you cannot use dot-notation here. The name of the property is `first-name`. If you typed `stooge.first-name`, the parser would interpret that as `stooge.first - name`. undefined minus undefined is... NaN!
This is just a way to access properties dynamically from an object. In this cause since there is an array of strings, it lets you get the value from the object. Since you can't do something like obj.'some-string'

This might help [JavaScript property access: dot notation vs. brackets?](https://stackoverflow.com/questions/4968406/javascript-property-access-dot-notation-vs-brackets)