facg3 / chemics

0 stars 1 forks source link

for vs. forEach? #26

Open sultanassi95 opened 6 years ago

sultanassi95 commented 6 years ago

I would suggest excluding for loops when handling operations on arrays. https://github.com/facg3/chemics/blob/170e4ac80db74d357b1ad59a5d5867ae88b35a90/public/script.js#L13 and in: https://github.com/facg3/chemics/blob/170e4ac80db74d357b1ad59a5d5867ae88b35a90/src/router.js#L26

You may found some useful information about why forEach works better in arrays! ForEach vs For

yahyaHB commented 6 years ago

thnx man but the for loop did the break thing for us and it's less complicated