JSFiddle - React, Tailwind, and code Playground
by Qwerty_Wasd
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
window.addEventListener("load", function() {
let genArr = Array.from(
{
length: parseInt(prompt("Введите размерность массива, число (по умолчанию 10)")) || 10,
},
function() {
return Math.floor(Math.random() * 21) - 10;
}
);
window.document.write("Сгенерированный массив: [" + genArr + "]");
genArr = null;
});
</script>
</body>
</html>