Tell us what’s happening:
I am quite sure the code is correct and it is displaying 9 html li’s as per the length of the array. But I am getting:
// running tests
Your document should have 9 h2 elements.
Cannot read property ‘length’ of null
// tests completed
Your code so far
<body>
<script>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
// Add your code below this line
d3.select("body").selectAll("h2")
.data(dataset)
.enter()
.append("li")
.text("New Title")
// Add your code above this line
</script>
</body>
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
.
Link to the challenge: