xxxxxxxxxx
function idGen(){
let array = [];
for(let i=0; i<=5; i++){
let id = Math.floor((Math.random()*1000)+100);
array.push(id);
}
let convert = array.join("-");
return convert;//Example: 816-728-1013-821-908-660
}
xxxxxxxxxx
$ npm install uuid
const uuidv4 = require("uuid/v4")
uuidv4()
// expected: 1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed