Hmm, not quite, something wrong with your main, but whatever.
I had hoped to be able to run this, but without a database, I guess that’s not going to happen.
First thing I noticed (or actually Chrome did it for me ):
levelData[i][j] = Math.floor(Math.random() * (maxTileRange - minTileRange + 1) ) + minnTileRange;
minnTileRange is not defined → typo