<button>Создать</button> <script> var rnd =()=> Math.floor(Math.random() * (100 + 100)) + -100; document.querySelector('button').onclick = e =>{ var arr = []; for (var i =0; i<5; i++) arr.push(rnd()); console.log(arr); }; </script>