concept child in category svelte
appears as: children, Child, Child, The children

This is an excerpt from Manning's book Svelte and Sapper in Action.
Note
<script> export const taxRate = 0.07; let price; let prices = []; $: total = prices.reduce((acc, n) => acc + n, 0); function add() { prices.push(price); prices = prices; #1 price = ''; #2 } export const getGrandTotal = () => total * (1 + taxRate); </script> <input type="number" bind:value={price} /> <button on:click={add}>Add</button> {#each prices as price} <div>{price}</div> {/each} <hr> <label>Total {total}, Tax Rate {(taxRate * 100).toFixed(2)}%</label>