Page 1 of 1

Warum wird in JavaScript [etwas] als Array angesehen?

Posted: 21 Mar 2025, 01:11
by Anonymous
In JavaScript stammt die folgende Deklaration aus einer Texteingabe: < /p>

Code: Select all

numberInput = document.getElementById('number-input');
< /code>
In HTML, "Number-Input" ist Folgendes: < /p>

Die NumberInput Variable wird an eine solche Funktion übergeben:

Code: Select all

function processInputs(list)
let total = 0;
// add the items in list to a total
for (const item of list) {
total += item;
}
Warum processinputs ([numberput]) Numberput als Array/Nodelist?