I have a JSON object and I need to extract a particular array of ids.
This is my jQuery code:
<script>
jQuery(function() {
jQuery.getJSON('/api/contents.json', function(data) {
var lessonContent = data.t;
console.log(lessonContent);
});
});
</script>
And this is what the Chrome Console shows:
642 {sfwd-lessons: Array(36), sfwd-topic: Array(0), sfwd-quiz: Array(0)}sfwd-lessons: (36) [64601, 64582, 64605, 65065, 65833, 68754, 69691, 73694, 64591, 64693, 65120, 65298, 66005, 72771, 72707, 73416, 74536, 65710, 65712, 65714, 65716, 65718, 65720, 65722, 65724, 65726, 65728, 65730, 65732, 65734, 65736, 65738, 65740, 72028, 72030, 72584]sfwd-quiz: []sfwd-topic: []__proto__: Object
How can I access the sfwd-lessons
array to get all the listed ids?
Thank you all.