Copying certain faces from existing mesh to new one

I was looking at this great example where you can select faces/triangles on the mesh

image

Really the selection isn’t my issue/question. Rather I would like to be able to clone just those faces into a new mesh, and of course I would like this to work with any shape/mesh. Assuming I have a list of existing faces, how does one go about doing that? Any guidance is apricated.

You can copy the vertices of faces into an array and rebuild the geometry in a loop