I want to pick 6 random id’s [duplicate]

I’m trying to pick 6 random ids from a api. So far I’m printing all of them.


function makeCatLi(cat){
    
    const newLi = document.createElement("LI"); 
    for (let i = 0; i < 6; i++) {
      let randomIndex = Math.floor(Math.random() * cat.id);
      newLi.innerText = randomIndex;
      body.append(newLi);
    }
}

I appreciate any help. And I only want to use vanilla JS.