Work with Data in D3 - syntax error?

Work with Data in D3 - syntax error?
0

#1

Tell us what’s happening:
I feel that I’m missing a syntax error. What is it?

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("h2").append("New Title"); 
    
    
    // Add your code above this line
  </script>
</body>

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 7.0; LGMS210 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/data-visualization/data-visualization-with-d3/work-with-data-in-d3


#2

What goes in the .append() call should be the HTML tag that you want to append (like .append("h2")). .enter() doesn’t accept any arguments. Then the "New Title" text goes in a .text() call right after append().

Refer to the instructions for an example.


#3

Thanknyou so much! Growing pains ofndoing this all for the first time.