Olga27,
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script>
const bukvy = ['А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ж', 'З',
'И', 'Й',
'К', 'Л', 'М', 'Н', 'О', 'П', 'Р',
'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я'
];
let word = 'лес';
function showInfo(word) {
let endWord = bukvy.slice(0).sort(_ => .5 - Math.random() ).slice(0, 16 - word.length)
return word.split("").concat(endWord)
}
</script>
</head>
<body onload="alert(showInfo(word));">
</body>
</html>