Iteratoren lösen das Problem des Speicherns und Inkrementierens von Array Indizes beim Aufrufen von Objekten.
Iterators solve the problem of storing and incrementing array indexes when accessing objects.
Das folgende Beispiel verwendet lastIndexOf, um Werte in einem Array Indizes eines Elementes in einem Array zu finden, wobei sie mit Hilfe von push zu einem anderen Array hinzugefügt werden, sobald sie gefunden werden.
The following example uses lastIndexOf to find all the indices of an element in a given array, using push to add them to another array as they are found.
Hinweis: Hat ein Array Indizes, die nach einem Durchlauf durch diese Funktion gleich sind (z.B. "keY" und "kEY"), überschreibt der spätere Wert im Array andere Indizes.
Note: If an array has indices that will be the same once run through this function (e.g. "keY" and "kEY"), the value that is later in the array will override other indices.
Autres résultats
Die Programmierer stießen auf ein Zaunpfahlproblem bei der Berechnung der Array-Indizes.
The programmers encountered a fencepost problem when calculating the array indices.
Die Implementierung der binären Suche erfordert ein Verständnis dafür, wie Array-Indizes behandelt werden.
Bei Array-Indizes markiert die schließende eckige Klammer (]) das Ende des Index.
With array indices, the closing square bracket (]) marks the end of the index.
Contenu potentiellement sensible ou inapproprié
Les exemples vous aident à traduire le mot ou l’expression cherchés dans des contextes variés. Ils ne sont ni sélectionnés ni validés par nous et peuvent contenir des mots ou des idées inappropriés. Signalez des exemples à modifier ou à retirer. Les traductions potentiellement sensibles, inappropriées ou familières sont généralement marquées de rouge ou d’orange.