Why am I getting this error in the Chrome console: "Uncaught SyntaxError: Unexpected token ':'"?
I have a JSON file located at the root of my application:
<script src="levels.json"></script>
Here is the content of my JSON file:
{
"levels": [
[22, 22],
[33, 25]
]
}
Below is my JavaScript code:
let data = JSON.parse(levels)
console.log(data);