Svelte · Middle · Question 54 of 75

Which statement about {#each} with destructuring is correct?

{#each items as { name, qty } (name)}
  <input bind:value={qty} />
{/each}

Explanation

Svelte's best practices advise avoiding destructuring when you need to mutate the item.

Further reading

Problem with a question

Svelte · Middle · question 54

Test yourself

Take the Svelte · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz