> Or does that `$data[]` array syntax do something special? (JS dev here, some of the PHP syntax nuances are out of my ken!)

`$data[] = $foo` is the equivalent of `data.push( foo )` in JS; that is, it's special syntax for appending to an array, using a numeric index.