如何从JSON文件读取数据?

我正在使用Javascript制作2D Pacman副本游戏,但在从Javascript中的json文件读取数据时遇到了一些麻烦。现在,默认地图只是硬编码为一个列表,但我要做的是为每个地图创建一个单独的JSON文件并能够从中读取

the file that contains the MazArray is app.js which is inside the build folder The link to my github project

this the example of the game here is the link to my game in my website

下图显示了我当前的MazeArray,但我想将其放在Json文件中并从中读取

Maze Array