<body>
<script>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
d3.select('body')
.selectAll('h2')
.data(dataset)
.enter()
.append('h2')
.text(d => d + ' USD');
// Add your code below this line
.style('font-family', 'verdana');
// Add your code above this line
</script>
</body>
nothing wrong with my code, but console give me this error:
SyntaxError: unknown: Unexpected token (11:6)
9 | .text(d => d + ' USD');
10 | // Add your code below this line
> 11 | .style('font-family', 'verdana');
| ^
12 |
13 |
14 | // Add your code above this line
After further inspecting the code, I found that I have to remove “;” from line code above
the comment “// Add your code below this line”
my final code:
<body>
<script>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
d3.select('body')
.selectAll('h2')
.data(dataset)
.enter()
.append('h2')
.text(d => d + ' USD')
// Add your code below this line
.style('font-family', 'verdana');
// Add your code above this line
</script>
</body>
it’s pretty confusing for 5 minutes struggling to finish this.