Loop over and render a list of data using an `each` block in Svelte 3

InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

Quite often we need to be able to loop over and render a list of data that (for example) is returned from the backend.

In this lesson we are going to learn how to use each block from Svelte to iterate over a list of data and render a list of European cities. We're also going to learn how to get the current index while iterating over a list, as well as how to destructure a currently iterated over element of the array.