📜  获取随机 id javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:24.450000             🧑  作者: Mango

代码示例3
let ID = (length = 6) => {
    // new Date() will return current time
      // getTime() method returns the number of milliseconds* since the Unix Epoch.
    // -length to get last items on string
    return new Date().getTime().toString().slice(-length);
}