Tell us what’s happening:
I can’t do even this simple task of " Work with Dynamic Data in D3". The lesson is very unclear. If I add “selection.text” it says that selection is undefined, unknown.
<body>
<script>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
d3.select("body").selectAll("h2")
.data(dataset)
.enter()
.append("h2")
// Add your code below this line
selection.text("(h2)=>USD") // i tried this
// and this
selection.text("(d)=>h2=>USD")
// Add your code above this line
</script>
</body>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
.