6 Matching Annotations
  1. Oct 2020
    1. A reasonably clean alternative would be to map a function over the array and use destructuring in the each loop: {#each [1, 2, 3, 4].map(n => ({ n, sqr_n: n * n })) as { n, sqr_n }} {sqr_n} {sqr_n / 2}<br> {/each}
    1. If you prefer, you can use destructuring — each cats as { id, name } — and replace cat.id and cat.name with id and name.
  2. Sep 2020
  3. Aug 2019
  4. Jul 2018