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.
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.