numpy.ndarray equivalent in Javascript

I am looking to implement a simple game in Javascript. The game is played by placing colored pieces on a grid, so a natural way to maintain the board state is with a 3D bool matrix, with dimensions corresponding to the board height, board width, and color, respectively. I also want to maintain similar auxiliary matrix structures that make it easier to compute valid moves and to compute game state transitions after moves. Finally, I hope to implement an AI player that runs within the browser, that relies on tree-search, so I want the state tracking operations to be efficient.

In python, I would use numpy.ndarray for this purpose. The data representation is compact, and I am able to perform the necessary update operations on the matrices elegantly and efficiently without for-loops by using various matrix operators like logical-{and,or,not}. I am also able to reassign a single entry within a matrix without needing to reassign the entire matrix.

I am wondering if there is something equivalent in the Javascript world. I know that I can use an array of arrays, but I lose representation compactness along with elegance and efficiency. The tensorflowjs library has the tensor object, which satisfies all those wants, but as far as I can tell, the immutability of the tensor object demands that I reassign the entire tensor whenever I want to reassign a single entry within it, which is a minor drawback. Finally, I’ve seen some other projects like scijs/ndarray which seem like they might fit the bill. But these seem to not be actively maintained, so I want to make sure I’m not missing something that is more commonly used.