You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/function-expression-inline/main.svelte

13 lines
192 B

<script>
let list = [1, 2, 3];
</script>
<button on:click={event => {
list = list.map(item => {
return item * 2;
});
}}>click me</button>
{#each list as number}
<p>{number}</p>
{/each}