编辑代码

const str = Math.random().toString(36).substr(2, 10);
console.log(str);   // 'w5jetivt7e'