Fetching in D3.js

Tell us what’s happening:
I am curious why is the example project using d3.json(url,(err,data=>{})) to fetch the external data from api,instead of using fetch api ,xhr or ajax . also ins’t it supposed to be data as first parameter and error as second parameter.

Your browser information:

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

Challenge: Visualize Data with a Bar Chart

Link to the challenge: