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!
Object properties can be accessed with a `.`. or with `[]`. 

But dot notation won't work here.

because if you switch `stooge[properties[i]]` to `stooge.properties[i]` it would return undefined, because the `stooge` object doesn't have a member named `properties`.