// function createCode () { const str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; let text = ''; for (let i = 0; i < 20; i++) { const number = Math.floor(Math.random() * str.length); const t = str.charAt(number); text += t; } return text; }