Set a Domain and a Range on a Scale1

Set a Domain and a Range on a Scale1
0

#1

Tell us what’s happening:

Can someone tell how can I do it?

Your code so far


<body>
  <script>
    // Add your code below this line
    const scale = d3.scaleLinear();
    scale.domain([250,500])
    scale.range([10,150])
    
    
    // Add your code above this line
    const output = scale(480);
    d3.select("body")
      .append("h2")
      .text(output);
  </script>
</body>

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/data-visualization/data-visualization-with-d3/set-a-domain-and-a-range-on-a-scale