What do square brackets around an expression mean, e.g. `var x = a + [b]`?

Viewed 104180

We have received some JavaScript from an agency that looks wrong, but works.

For some reason they are adding square brackets ([, ]) around variables, like this:

var some_variable = 'to=' + [other_variable];

This works, but the square brackets seem completely superfluous.

Is there a purpose of using this syntax or is it technically incorrect, but ignored by the browser?

7 Answers
Related