Warum wird in JavaScript [etwas] als Array angesehen?
Posted: 21 Mar 2025, 01:11
In JavaScript stammt die folgende Deklaration aus einer Texteingabe: < /p>
Die NumberInput Variable wird an eine solche Funktion übergeben:
Warum processinputs ([numberput]) Numberput als Array/Nodelist?
Code: Select all
numberInput = document.getElementById('number-input');
< /code>
In HTML, "Number-Input" ist Folgendes: < /p>
Code: Select all
function processInputs(list)
let total = 0;
// add the items in list to a total
for (const item of list) {
total += item;
}