(() => {

  //UUID Fn-1
  S4 = () => {
        return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
    };
  //UUID Fn-2
  guid = () => {
        let me = this;
        return (me.S4()+me.S4()+"-"+me.S4()+"-"+me.S4()+"-"+me.S4()+"-"+me.S4()+me.S4()+me.S4());
    };

  let oUuid = guid();
  let oArr = ['Apple','Banana','Orange','Cheer'];

   oArr.forEach((v,i,a) => {
        this.v = `${v}-${guid()}`;
        console.log(this.v);
    });
})();

// Apple-2b51f63b-45c8-070f-e3aa-71184a90eb3f
//Banana-e1ccf286-9d65-e7a0-0949-8bba1077554a
// Orange-a2e973fb-1c6f-6a82-c57d-fb7ae4143a1e
//Cheer-23d85cd0-3006-c1d3-fec0-79ba5458e5f6

 

相关文章:

  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2021-09-11
猜你喜欢
  • 2023-04-06
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-01-26
  • 2021-05-28
相关资源
相似解决方案