Markdown parsers can auto-generate IDs for headers but they don't create a nice icon next when you hover over the header. That's what Anchor.js is for. For an example, see this page: https://kubernetescommunitydays.org/organizing.
Those auto-generated anchors remind me of LaTeX references. You have to write the anchor IDs in manually ... but when you re-word your heading you don't suddenly break all of your links to it.
I know these, but there's also CSS so I don't understand why this needs JS..