Kevin Powell - CommunityKP-C
Kevin Powell - Communityβ€’4y agoβ€’
6 replies
winniffy

forEach method

i'm finding it difficult to understand this code snippet? could someone please tell me what the slide and index do?

i tried to change the forEach method to a forLoop so i can understand it better, but i could not access the slide property.

this is my attempt to rewrite it in forLoop method:
for(index=0; index<slides.length; index++){ slide.style.transform = translateX(${index * 500}px); }
code-snapshot.png
Was this page helpful?