showArray is a function witch show the content of json file, what's wrong in my function? why it doesn't work
function getArray() {
var quest = [];
$.getJSON('data.json', function (json) {
for (var key in json) {
if (json.hasOwnProperty(key)) {
var item = json[key];
quest.push({
Name:item.Name
});
}
}
callback(quest);
});
}
$(document).ready(function () {
getArray();
});
function showArray() {
var callback = function (quest) {
console.log(quest)
}
}