Dataviewjs help. How to create a table of content from pages?

How to create the table of contents (with URL that can jump to these headers) for these headers?

Here is what I want to do:

    dv.paragraph(`How to create the table of content for these headers?`);
    
    dv.paragraph(`# Header 1`);
    let content1 = await dv.io.load(`1.md`);
    dv.paragraph(content1);
    dv.paragraph(`# Header 2`);
    let content2 = await dv.io.load(`2.md`);
    dv.paragraph(content2);
    dv.paragraph(`# Header 3`);
    let content3 = await dv.io.load(`3.md`);
    dv.paragraph(content3);