Question d’entretien chez TIME (Malaysia)

Best way to loop through array

Réponse à la question d'entretien

Utilisateur anonyme

31 oct. 2023

In case of multiple iterations of the loop, and where the size of the array is too large, for loop is preferred as the fastest method of elements iteration. While loops perform efficient scaling in the case of large arrays. In the case of functional codes, for each loop performs better with a much optimized time.