I'm trying to make a sporcle-esque quiz game for a school project regarding the top scorers in NBA History so the way I'm doing is I have an array of all the top 25 scorers (in order) and I have a seperate array of their respective point totals. So I'm trying to build out a table using javascript and looping through the for loop.
This is my code for that:
{
var row = document.createElement("tr")
mytable.appendChild(row)
var rank = document.createElement("td")
rank.innerHTML = i+1+""
row.id = answers[i];
var name = document.createElement("td")
name.innerHTML = answers[i]
var points = document.createElement("td")
points.innerHTML = points[i]
row.appendChild(rank)
row.appendChild(name)
row.appendChild(points)
} ```
When I run this I get this error "Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'." and the error comes at the second last line when I say "row.appendChild(name)"
I can't figure out why I'm getting this error.