Please look at this svelte REPLE. when you duplicate an item then if you change the input of each duplicated item all other are changing. why is it? how to avoid this behavior?
https://svelte.dev/repl/991786b9def049249e185e5168afff5a?version=3.46.4
<script>
const foodList = [
{ icon: '๐ฒ', elem: "111" },
{ icon: '๐ฅซ', elem: "222"},
{ icon: '๐', elem: "333" },
];
const duplicate = (index) => {
foodList.splice(index +1, 0, foodList[index]);
foodList = foodList;
};
</script>
{#each foodList as {icon, elem}, index}
<div>
{icon} {elem}
<input bind:value={elem} />
<button on:click={() => duplicate(index)} >duplicate</button>
</div>
{/each}