Work with Data in D3 explaination

i passed this test but i need some explanation on this,i thought i have to pass the values of the array into h2 but it basically creates h1 elements = dataset.length. What is the point of this?(Hope i am not being impatient)

Your code so far

    const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
    // Add your code below this line'body').selectAll('h1')
    .text('New Title') ;   
    // Add your code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:

I think I don’t understand your question.

You should select() the h2 instead of h1 because it’s the element being cloned as many times as the number of elements in the dataset that you’re passing to the data() method.

i meant that how are the values of the array being passed into the variable d

I think you’re crossing threads here lol

The conversation about the variable d is in another thread :smiley: