Each block bindings

You can even bind to properties inside an each block.

  1. <input
  2. type=checkbox
  3. bind:checked={todo.done}
  4. >
  5. <input
  6. placeholder="What needs to be done?"
  7. bind:value={todo.text}
  8. >

Note that interacting with these <input> elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.