I keep getting an error saying .forEach is not a function I have a very similar function that runs just fine but I can't figure out how to fix this forEach issue
function populateRepsDiv(repsArray) {
removeChildren(senatorDiv)
repsArray.forEach(representative => {
const repFigure = document.createElement('figure')
const repImg = document.createElement('img')
const repCaption = document.createElement('figcaption')
repImg.src = representative.imgURL
repCaption.textContent = representative.name
repFigure.appendChild(repImg)
repFigure.appendChild(figCaption)
senatorDiv.appendChild(repFigure)
console.log(representative.name)
})
}