var api = new XMLHttpRequest();
api.open("GET", "http://swapi.co/api/films/", true);
api.onload=function(){
var data=JSON.parse(this.response);
data.forEach( film => {
console.log(film.title);
});
}
api.send();
results
.data.results.forEach( film => {
var data = JSON.parse(response, function(key, value) {
console.log(key, value);
});