Thanks guys, i figured it out by checking and rechecking the dev console, but mostly staring at the monitor in disbelief. I actually need help now to get it to work with a server tried few including a local one and no luck.
Valuable Lesson
$.getJSON("package.json", /*loads, if in the same folder*/ function (json) {
theQuiz = json.quiz; // Had to make sure to pick out the array because JSON put it into an extra object
console.log(theQuiz); // object Array
console.log(json); // object Object
console.log(theQuiz[0].question); // Works! "How many times your heart beats in a day?(choose the closest)"
// but it's not working because js doesn't wait for JSON to load and it starts using the variables that doesn't exist yet
});
Solution
$.ajax({
dataType: "json",
async: false, // Makes sure to wait for load
url: "package.json", // https://www.dropbox.com/s/fmw63i4v7dtnx6t/package.json
'success': function (json) {
theQuiz = json.quiz;
console.log(json); // object Object
console.log(theQuiz); // object Array
// Finishes loading before js starts using it, and works as intended
}
});