Creating a loop that creates multiple divs with unique ids and names in JavaScript

I want to create multiple div html elemwnts in the dom that have unique ids and names – that is after each loop the name and id of the div element changes e.g first div will be div1 and id name will be divId1 while second will be div2 and id will be divId2;

let body = document.querySelector('body')
let num;
//num will be depend on users choice

for(i=0;i<num.length;i++){
  const div1 = document.createElement('div')
  div1.id = 'divId1'
  //the div styling comes here
  body.appendChild(div1)
  /*
  Next div shkuld have name of div2, id of divId2 and appended as div2
  */
}

This will Just create multiple HTML div elements with same ids.