I want to read a JSON file into a variable. My JSON file would be named "questions.json" and will have this type of content:
{
question: "Question 1?",
answers: {
a: "A",
b: "B",
c: "The Correct One"
},
correctAnswer: "c"
},
{
question: "Question 2?",
answers: {
a: "A",
b: "B",
c: "The Correct One"
},
correctAnswer: "c"
}
I have tried many things to work this out, such as: loadStrings and then parse the string as a JSON type (told me that loadStrings is undefined), really everything i found on the web with reading local files in javascript and nothign really worked..