📜  javascript 生成唯一 ID - Javascript 代码示例

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

代码示例6
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);
}