A more elegant solution? Work with Dynamic Data in D3

Tell us what’s happening:

Hey everyone! Hope you’re well :slight_smile:

I’ve checked the forums and seen a few ways to get passed this challenge, but they all look rather hacky. Can anyone please tell me how I could concatenate the " USD" onto my h2 tags with a simple and elegant solution?

Thanks in advance!

Your code so far

    const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
      // Add your code below this line
      .text((d) => d).concat();
      // Add your code above this line

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:

Have you been able to solve this challenge with your own solution yet? The code you posted would error out.

Hey Randell :slight_smile: I tried to delete this post moments after I wrote it but I couldn’t figure out how :joy: I was being stupid, the answer was super obvious. The thing I tried first was correct, I just screwed up the brackets the first time.

Thanks for your reply!