I'm trying to loop through JSON data that I'm pulling from a file. I'm using the require function to get the JSON file but it keeps telling me there is an unexpected '{' token? positions on IDE and console are a little off but I'm pretty sure it's the second objects opening { -position 44-
Any suggestions?
myData.json
{
"colour" : "blue",
"cm" : 2
}
{
"colour" : "red",
"cm" : 5
}
index.js
const fileContents = require("./myData.json");