Documentation - How can I tell when a function accepts callbacks?

I’m currently learning D3 and am doing the Scatterplot Graph project. I was trying to figure out how to format my y-axis to convert the ticks from seconds to MM:SS. When reading the D3 documentation, I came up to this page: https://github.com/d3/d3-format#locale_format

I couldn’t quite figure how to use the function so I looked up elsewhere and found this on Stack Overflow: https://stackoverflow.com/a/51975876/688707

Both of these solutions here helped solve my problem, but my question is: How did they know you could use a callback function for tickFormat? Where do people look for this information?

The best place you can find this is in the library’s documentation. The d3 docs happen to be found in their GitHub repo. For example here’s the docs for tickFormat: https://github.com/d3/d3-3.x-api-reference/blob/master/SVG-Axes.md#tickFormat

Check out DevDocs for a list of documentation for various languages/libs/frameworks/etc.

How did you get to that link? If you start here (https://github.com/d3/d3) and you click the API Reference link you get to here (https://github.com/d3/d3/blob/master/API.md). When I click Axes and the axis.TickFormat link it sends me here (https://github.com/d3/d3-axis/blob/master/README.md#axis_tickFormat). How did you manage to get to (https://github.com/d3/d3-3.x-api-reference/blob/master/SVG-Axes.md#tickFormat)?

I found that page on DevDocs. Documentation pages there have a link to the original page at the bottom.

By the looks of the stackoverflow code, it looks like d3 version 3, which devdocs happen to have documentation for.