Fix JS, dot notation instead of index notation.

Just a quick fix because it seems more natural this way.