How do I convert JSON from a file into an array in JavaScript?

kel4n4

New Member
I am having trouble parsing JSON. The JSON is properly getting read (as seen in the console), however, I am unable to get the array to save any of the data. I have looked at similar questions but none of them seemed to help my problem. Thank you in advance for any help.\[code\]function getArray(){ return $.getJSON('testJSON.json');}getArray().done(function(json) { $.each(json, function(key, val) { words.push(key); console.log(key); });});\[/code\]
 
Back
Top