Build a TodoList class with add / toggle / remove / filter (active|done|all).
Time to put it together. Build a class `TodoList` with this API:
- `add(text)` — push `{ id, text, done: false }`. Auto-increment id starting at 1.
- `toggle(id)` — flip the `done` flag of that todo.
- `remove(id)` — delete the matching todo.
- `filter(kind)` — return an array filtered by kind: `"active"` (done=false), `"done"` (done=true), or `"all"`.
Example:
```
const list = new TodoList();
list.add("learn js");
list.add("ship it");
list.toggle(1);
list.filter("done"); // [{ id:1, text:"learn js", done:true }]
list.filter("active"); // [{ id:2, text:"ship it", done:false }]
```
This task uses pattern matching — make sure each method is present and uses the right array helper.Sign in to save your code and track progress across devices.