Multidimensional array helpers for JavaScript