function getRandomNum(n) {
  let rdmNum= "";
  for (let i = 0; i < n; i++) {
    rdmNum+= Math.floor(Math.random() * 10); // an integer of [0,10]
  }
  return rdmNum;
}
// let id = "T" + RndNum(6); // Generate a random seven-digit number starting with T, for example, T419075
Copy the code