1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

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

    sveltesvelte

    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.