Lesson 6 of 21 · Markup
Lists
#for makes elements from a list. key gives each row an identity. When the list changes, Surface keeps the rows that stay, and it moves them. The empty block shows when the list has no items.Values in Surf are values, not references. todos.filter(...) makes a new list.Your turn
- Add a Remove button to each row.
- On a press, keep only the todos with another id: todos = todos.filter(t => t.id != todo.id).
Preview
1 error
The sandbox needs a browser.