Sorry for the basic question, I am very new to promises etc. Just wondering what the meaning of the 3rd line is?
window.onload = (function(){
fetch('http://localhost:8080/CarSales/rest/cars')
.then((resolve) => resolve.json())
.then((data) => {
var output = '';
data.forEach(function(cars){
output += '<tr><td>'+cars.make+'</td><td>'
+cars.model+'</td><td>'+cars.year+'</td><td>'
+cars.engine+'</td></tr>';
});
document.getElementById('table-body').innerHTML = output;
})
})