Thread:Manual talk:Coding conventions/JavaScript/Whitespace inside of square brackets/reply (2)

I think this is outdated – I believe that the rule is now you always have spaces when creating an array, but never when accessing:

var array = [ 'foo', 'bar' ]; array[0].print;
 * Right

var array = ['foo', 'bar']; array[ 0 ].print;
 * Wrong