Assignment is flawed?

Tell us what’s happening:
when I do this:
// Add your code below this line
i * 30
// Add your code above this line
I should be working. But I have to erase the curlu-braces just outside the “add your code here”-area, and then it works. This code is also reflected in the following assignments starter code.
Maybe it is a error?

Your code so far


<body>
<script>
  const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];

  const w = 500;
  const h = 100;

  const svg = d3.select("body")
                .append("svg")
                .attr("width", w)
                .attr("height", h);

  svg.selectAll("rect")
     .data(dataset)
     .enter()
     .append("rect")
     .attr("x", (d, i) => {
       // Add your code below this line
i * 30


       // Add your code above this line
     })
     .attr("y", 0)
     .attr("width", 25)
     .attr("height", 100);
</script>
</body>

Your browser information:

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

Challenge: Dynamically Set the Coordinates for Each Bar

Link to the challenge:
https://www.freecodecamp.org/learn/data-visualization/data-visualization-with-d3/dynamically-set-the-coordinates-for-each-bar

You missed out return, that’s why it doesn’t work.

You can miss out the curly braces on an arrow function if the return value is a single expression, which it is in this case, which is why that works.