Eu transformei o JSON para objetos e coloquei em uma array de pacientes. Quando vou colocar na tabela as TDS ficam vazias.
Sei que o problema está no momento em que as TRS são formadas, porém não estou conseguindo localizar.
https://github.com/LauraBeatris/nutrition-javascript
button.addEventListener("click", function(){
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://api-pacientes.herokuapp.com/pacientes");
xhr.send();
xhr.addEventListener("load", function(){
var response = xhr.responseText;
var patients = JSON.parse(response);
console.log(patients);
patients.forEach(function(patient){
addPatient(patient);
})
});
});