Witam mam problem ze zrozumieniem co robią poszczególne wiersz i prosił bym o wyjasnienie w skrócie co robią.Te wiersze których nie rozumiem są ponumerowane od 1. do 5.
<input id="tabela" type="number">
<button id="przycisk">UTWÓRZ</button>
<table id="tablica"></table>
<script>
var _input = document.getElementById('tabela');
var _button = document.getElementById('przycisk');
var _table = document.getElementById('tablica');
function makeTable (array) {
1. for ( let i = 1; i < parseInt(array) +1; i++ ) {
2. var _tr = document.createElement('tr');
3. _tr.innerHTML = `<td> ${i} </td> <td> ${Math.floor(Math.random() * 101)} </td>`;
4. _table.appendChild(_tr);
}
}
5. _button.addEventListener('click',()=> {
makeTable(_input.value);
}
)
</script>